Solved

How to add a text box in a GUI by uisng SWT package?

Posted on 2013-06-18
1
419 Views
Last Modified: 2013-06-19
Hi,
I have GUI that I am creating using SWT package.

The GUI has a toolbar and under the toolbar, I would like to add a text box where I can type.

How can I add this text box in my GUI using SWT package?

I am sending a screen shot in the attachment and I marked the textbox area in red.
text-box.png
0
Comment
Question by:Tolgar
1 Comment
 
LVL 16

Accepted Solution

by:
Valeri earned 500 total points
ID: 39258014
right after the horizontal line under the whole tool bar add these lines:
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);
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question