Link to home
Start Free TrialLog in
Avatar of Tolgar
Tolgar

asked on

How to add a title and a context info to the textbox in SWT?

Hi,
I have a GUI and in this GUI I have a toolbar and a textbox under the toolbar.

I would like to add a title (named "Files in List") to the textbox field. (I marked it in red in the attachment)

Also, I would like to put some note into the textbox in light gray color to give some information to the user about how to use the textbox. But this light gray text should disappear when you click on the textbox field. (I marked it in blue in the attachment)

This is the code I used to create the text box. I added this code after the creation of all the tabs.

        //This is the text box
        GridData txtGridData = new GridData(GridData.FILL_BOTH); txtGridData.horizontalSpan = 2;
        Text txt = new Text(compTab1, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
        txt.setLayoutData(txtGridData); 

Open in new window


I am sending a screen shot in the attachment to show the view.
text-box-title.png
ASKER CERTIFIED SOLUTION
Avatar of Valeri
Valeri
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial