Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Fill Layout and Sash question
Fill Layout and Sash question [message #444562] Thu, 14 October 2004 18:34 Go to next message
Eclipse UserFriend
Originally posted by: James.Corbett.CCRA-ADRC.GC.CA

I am working on a projec that is requiring the use of the Fill Layout and
Sash Forms. I also want to place a label at the bottom of my parent form
to be used as a status line.

However, regardless of my setLocation values the label is forced to the
top left due to the Fill layout.

Is there a means of protecting an area so as that I could keep my label at
the bottom of my parent form?

Jim
Re: Fill Layout and Sash question [message #444564 is a reply to message #444562] Thu, 14 October 2004 19:06 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
1) FillLayout is pretty simple.
2) You can't mix using layouts and setting size and location - you use
either one or the other.

Perhaps you should use FormLayout or GridLayout to acheive the result you
want:

public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FormLayout());
Button b = new Button(shell, SWT.PUSH);
b.setText("Button grabs all space");
Label label = new Label(shell, SWT.BORDER);
label.setText("Label sits on bottom");

FormData data = new FormData();
data.left = new FormAttachment(0);
data.right = new FormAttachment(100);
data.top = new FormAttachment(0);
data.bottom = new FormAttachment(label);
b.setLayoutData(data);

data = new FormData();
data.left = new FormAttachment(0);
data.right = new FormAttachment(100);
data.bottom = new FormAttachment(100);
label.setLayoutData(data);

shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}

"Jim Corbett" <James.Corbett@CCRA-ADRC.GC.CA> wrote in message
news:ckmgre$2tm$1@eclipse.org...
>I am working on a projec that is requiring the use of the Fill Layout and
> Sash Forms. I also want to place a label at the bottom of my parent form
> to be used as a status line.
>
> However, regardless of my setLocation values the label is forced to the
> top left due to the Fill layout.
>
> Is there a means of protecting an area so as that I could keep my label at
> the bottom of my parent form?
>
> Jim
>
Previous Topic:List - SelectionEvent
Next Topic:Capturing the closing event of a window that has SWT components in it
Goto Forum:
  


Current Time: Sun Oct 25 23:30:05 GMT 2020

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

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

Back to the top