views:

255

answers:

1

I wonder if it is possible to set textPosition() for a label that includes an image and a text part so that the text is both TOP and LEFT. The problem I have now is that I need the text to be TOP but when that is selected the text is centered over the image. My wish is that the text is over the image but to the left and not centered. I wonder if there is a way to do this?

I have tried to add the text to one label and the image to another label and then contain them in a container but the problem is then that the alignment will be the same for all the items(text over image) and item over item. So it will not be possible to see if the text over the second image is part of the first image or the second.

Thanks.

A: 

Ok so this is what I mean. This is the current behaviour:

Label item = new Label();
item.setIcon(icon);
item.setText("House:");
item.setTextPosition(TOP);

Result:

House:

 /\

The wanted behaviour is:

Label item = new Label();
item.setIcon(icon);
item.setText("House:");
item.setTextPosition(TOP);
item.setTextPosition(LEFT);

House:

/\

I need to set TextPosition to both Top and left, is that possible? Or is there any otherway I can get this behaviour. If I use a container the result will be:

House:

/\

House:

/\

What I want is that the alignment between "House:" and /\ is separate from "House:" and the /\ above.

I hope this makes any sense. Hard to explain it in a good way. Thanks for any help you can give me.