label length within form toolkit [message #638655] |
Fri, 12 November 2010 00:49 |
Luca Ferrari Messages: 159 Registered: November 2009 |
Senior Member |
|
|
Hi all,
in my application I'm using a form toolkit for an editor and, besides all the widgets, I'd like to display a label that will report some error/notice messages. Since the layout of the form is a table wrap layout with two columns, I've defined such label as follows:
Label errorLabel = toolkit.createLabel( parent, "" );
errorLabel.setForeground( Display.getCurrent().getSystemColor( SWT.COLOR_RED ) );
TableWrapData twData = new TableWrapData();
twData.align = TableWrapData.CENTER;
twData.grabHorizontal = true;
twData.colspan = 2;
errorLabel.setLayoutData( twData );
The problem is that, when I set the text of the label after certain event occurs, the label does not show anything. After a while of testing I found that the label cannot display a new text longer than the one specified at the creation time, that is if I change the first line with the following:
Label errorLabel = toolkit.createLabel( parent, " " ); // 5 blanks
the text can be changed to a string no more longer than 5 characters.
Am I doing something wrong or is not possible to change the length of a label when it is created by a form toolkit?
Thanks.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03114 seconds