TextFlow [message #236410] |
Wed, 27 June 2007 14:17 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02704 seconds