• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. SWT Text Fields > Positioning the Text Field

5.3. Positioning the Text Field

When building a GUI, you need to have precise control over the positioning of every widget that makes up the interface. In SWT, there are two ways to specify the size and position of a widget within a container. The first approach is to use the setBounds() or setLocation( ) methods that are part of the super class for every widget.

5.3.1. How do I do that?

In the TextFieldExample class, the Text widget is positioned with this:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint