gridlayout : Issue with Alignment.MIDDLE_CENTER

Hi all,

About Vaadin 6.8.0, i want to center a little image using Alignment.MIDDLE_CENTER in gridLayout. The result is centered in the horizontal axis, but not centered in the vertical axis (see the screenshot below : the black image should be aligned with the number).
As the setComponentAlignment() function works fine with label here, i wonder if it is a bug ?

[size=2]
public class Test2vaadinApplication extends Application {
    private static final long serialVersionUID = 1L;

    @Override
    public void init() {
        final Window mainWindow = new Window("Myproject Application");
        //mainWindow.setWidth(245);javascript:;
        setMainWindow(mainWindow);
        mainWindow.getContent().setSizeFull();
        mainWindow.addComponent(new WindowOpener("Window Opener", mainWindow));
    }
}

public class WindowOpener extends CustomComponent implements Window.CloseListener {
	public WindowOpener(String label, Window main) {  //constructor
	        Window mainwindow = main;
	        mainwindow.setSizeFull();
	       
	        Embedded littleImage = new Embedded("", new ThemeResource("./little_image.jpg"));
	        Label label = new Label("4561");
	        
	        GridLayout gridlayout = new GridLayout(2, 2);//(column, line)
	        gridlayout.setWidth("140px");
	        setCompositionRoot(gridlayout);
	        gridlayout.addComponent(littleImage, 0, 0);
	        [color=#dd1f6b]
gridlayout.setComponentAlignment(littleImage, Alignment.MIDDLE_CENTER);
[/color]
	        gridlayout.addComponent(label,1,0);
	        gridlayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT);            
	}
}
[/size]

12610.jpg

Nobody knows the answer ? :frowning:

I have the same issue with some other Vaadin components : Firebug shows a DIV which contains the Vaadin component and an empty space at the top of it, i do not know how to remove this empty space
Example of div :
[color=#2525c9]

[/color]

Eric

Hi,

The problem is in your Embedded component constructor call: you define an empty string as the caption, which the layouts obediently display as an empty line of text. Pass a null in to the constructor if you don’t wish for the caption to show.