Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Label not Visible
Label not Visible [message #77097] Thu, 06 March 2008 13:56 Go to next message
Eclipse UserFriend
Originally posted by: me.micha-shl.de

Hey all,

I don`t know if it`s a bug or a 'feature'?!
I created my own Entrypoint, but in the first Version:

final Display display = new Display();
final Shell shell = new Shell(display);
shell.setSize(560, 420);
shell.setText("Shell Title");

shell.setLayout( new FillLayout());

final Label label = new Label(shell, SWT.CENTER);
label.setText("============= Start =================");
label.setVisible(true);
label.setEnabled(true);

shell.open();
...
the Label is not visible.
If I move the shell.setSize(560, 420) between the label.setEnabled(true)
and shell.open() the Label shows just fine.

Hope I don`t out me as an Newbie.

Regards
Michael
Re: Label not Visible [message #77111 is a reply to message #77097] Thu, 06 March 2008 15:30 Go to previous message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Michael,

Either you call shell.setSize() just before shell.open() or use
shell.pack() to trigger layouting. Otherwise the shell isn't layouted
and thats why your label isn't visible.

Regards,
Stefan.

Michael schrieb:
> Hey all,
>
> I don`t know if it`s a bug or a 'feature'?!
> I created my own Entrypoint, but in the first Version:
>
> final Display display = new Display();
> final Shell shell = new Shell(display);
> shell.setSize(560, 420);
> shell.setText("Shell Title");
>
> shell.setLayout( new FillLayout());
>
> final Label label = new Label(shell, SWT.CENTER);
> label.setText("============= Start =================");
> label.setVisible(true);
> label.setEnabled(true);
> shell.open(); ...
> the Label is not visible.
> If I move the shell.setSize(560, 420) between the label.setEnabled(true)
> and shell.open() the Label shows just fine.
>
> Hope I don`t out me as an Newbie.
>
> Regards Michael
Previous Topic:CoolBarManager issue
Next Topic:UIThread Problem
Goto Forum:
  


Current Time: Fri Apr 19 16:32:07 GMT 2024

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

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

Back to the top