Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » displaying text with textFlow
displaying text with textFlow [message #236418] Wed, 27 June 2007 14:25 Go to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Hi,

I made a little test application to try the usage of text flow


public class Label extends Figure{


public Label() {
TextFlow tf = new TextFlow("WRAPME WRAPME WRAPME");
FlowPage fp = new FlowPage();
fp.add(tf);
add(fp);
}

protected void paintFigure(Graphics graphics) {
Rectangle rect = getBounds().getCopy();
rect.crop(new Insets(0, 0, 0, 0));
graphics.fillRectangle(rect);
}
}

Main :
public static void main(String args[]) {
Display d = new Display();
final Shell shell = new Shell(d);
shell.setBackground(ColorConstants.white);
shell.setSize(400, 290);
LightweightSystem lws = new LightweightSystem(shell);
lws.setContents(new Label());
shell.open();
while (!shell.isDisposed())
while (!d.readAndDispatch())
d.sleep();
}

but nothing is displayed any idea ?

Thanks
Re: displaying text with textFlow [message #236462 is a reply to message #236418] Thu, 28 June 2007 08:31 Go to previous message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Solved by putting a content panel.
Previous Topic:Problem with figures in draw2d
Next Topic:scrollable text
Goto Forum:
  


Current Time: Thu Apr 25 05:30:19 GMT 2024

Powered by FUDForum. Page generated in 0.02656 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top