Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Label and Layout [Solved]

    Hi there,

    I have a lot of labels that i put into a Layout manager (such as HLayout or a HStack). The problem is that i need a "wrap" behavior when the labels exceed the Width size of the layout.

    The behavior im getting, is that the layout is resizing itself (after fixing a low width).

    I saw an old post (http://forums.smartclient.com/showth...t=layout+wrap), but without answer. I can't use a simple HTMLFlow because i need to have support to rich drag and drop events. So the solution i found, is to have multiple Labels.

    The question is, am i missing some property to enable a wrap behavior ? Or I got everything wrong ?

    Here its a sample code :
    Code:
    HLayout layout = new HLayout();
    layout.setWidth(800);
    layout.setHeight(600);
    
    for (int i = 0; i < 800; i++)
    {
    	Label lb = new Label("abc" + i + "d");
    	lb.setMargin(2);
    	lb.setWrap(false);
    	lb.setAutoHeight();
    	lb.setAutoWidth();
    	lb.setCanSelectText(true);
    	layout.addMember(lb);
    }
    Thank you in advance.
    Cheers
    Im using and old version of Smart GWT (1.2) with GWT 2.1.0


    SORRY, I GOT SOME THINGS WRONG, im looking into FlowLayout, should be good now
    Last edited by jmichelgarcia; 20 May 2011, 05:35.
Working...
X