Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Label Wrap
Label Wrap [message #444040] Tue, 05 October 2004 14:03 Go to next message
vipashwi is currently offline vipashwiFriend
Messages: 9
Registered: July 2009
Junior Member
hi

iam using grid layout for my form.

due to language changes....one of my label needs to wrapped to next line...

any suggestions....dont want to go the widthHint way....


thx
Re: Label Wrap [message #444044 is a reply to message #444040] Tue, 05 October 2004 15:00 Go to previous messageGo to next message
Marion Schmid is currently offline Marion SchmidFriend
Messages: 35
Registered: July 2009
Member
spontaneously I would say - providing SWT.WRAP as style for the Label ?
Label myLabel = new Label(parent, SWT.WRAP);

regards, marion

"vinay" <vinaybc@yahoo.com> wrote in message
news:cju9k8$9fa$1@eclipse.org...
> hi
>
> iam using grid layout for my form.
>
> due to language changes....one of my label needs to wrapped to next
line...
>
> any suggestions....dont want to go the widthHint way....
>
>
> thx
>
Re: Label Wrap [message #444048 is a reply to message #444044] Tue, 05 October 2004 16:29 Go to previous messageGo to next message
vipashwi is currently offline vipashwiFriend
Messages: 9
Registered: July 2009
Junior Member
Marion Schmid wrote:

Just by adding the SWT.WRAP does not make any difference



> spontaneously I would say - providing SWT.WRAP as style for the Label ?
> Label myLabel = new Label(parent, SWT.WRAP);

> regards, marion

> "vinay" <vinaybc@yahoo.com> wrote in message
> news:cju9k8$9fa$1@eclipse.org...
> > hi
> >
> > iam using grid layout for my form.
> >
> > due to language changes....one of my label needs to wrapped to next
> line...
> >
> > any suggestions....dont want to go the widthHint way....
> >
> >
> > thx
> >
Re: Label Wrap [message #444050 is a reply to message #444040] Tue, 05 October 2004 18:15 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
In 3.1, you can do the following:

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new GridLayout(3, false));
Button b = new Button(shell, SWT.PUSH);
b.setText("button 1");
Label l = new Label(shell, SWT.WRAP | SWT.BORDER);
l.setText("Here is a label that needs to wrap when it gets too long");
GridData data = new GridData();
data.grabExcessHorizontalSpace = true;
data.minimumWidth = 100; // optional
data.widthHint = 200; // optional but makes shell.pack() give a good
result
l.setLayoutData(data);
b = new Button(shell, SWT.PUSH);
b.setText("button 2");
shell.pack();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}


"vinay" <vinaybc@yahoo.com> wrote in message
news:cju9k8$9fa$1@eclipse.org...
> hi
>
> iam using grid layout for my form.
>
> due to language changes....one of my label needs to wrapped to next
> line...
>
> any suggestions....dont want to go the widthHint way....
>
>
> thx
>
Re: Label Wrap [message #444433 is a reply to message #444040] Tue, 12 October 2004 16:06 Go to previous message
Karsten Becker is currently offline Karsten BeckerFriend
Messages: 22
Registered: July 2009
Junior Member
Hi,
Maybe this Link makes everything more clear:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866

Karsten
Previous Topic:when to dispose of widgets/objects
Next Topic:Memory Leak
Goto Forum:
  


Current Time: Mon Oct 26 11:23:22 GMT 2020

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

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

Back to the top