Splitting an image in GWT results in unwanted white space

Posted by rancidfishbreath on Stack Overflow See other posts from Stack Overflow or by rancidfishbreath
Published on 2010-03-23T17:40:17Z Indexed on 2010/03/23 17:43 UTC
Read the original article Hit count: 359

Filed under:

I am using GWT 2.03 and am have an image that I want to place partially in an area with a background and partially above a background. I am using a FlexTable to try to accomplish this and have used GIMP to cut the image into two sections. I am trying to load the top part of the image into row 0 and the bottom part of the image into row 1. I set the alignment of the top image to ALIGN_BOTTOM but there is a bit of space at the bottom of cell and so the two parts of the picture don't touch.

Here is an image showing what I am talking about. I set the background of the cell to be yellow show where the cell boundaries are. The bottom image and background are rendering correctly.

alt text

Here is the relevant code snippet:

FlexTable table = new FlexTable();
table.setCellSpacing(0);
table.setCellPadding(0);
table.setBorderWidth(0);
FlexCellFormatter formatter = table.getFlexCellFormatter();

table.setWidget(0, 0, topImage);
formatter.setStyleName(0, 0, "topImageStyle");
formatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_BOTTOM);
table.setWidget(1, 0, bottomImage);
formatter.setStyleName(1, 0, "bottomImageStyle");

How can I get rid of that space between my image and the cell boundary?

© Stack Overflow or respective owner

Related posts about gwt