A control is an user-interface element that belongs to a higher-level window. In this section, we are going to describe some of the basic ones in detail, such as labels, texts, lists, layouts, buttons, and combos. These simple controls are commonly used when developing applications using the SWT. In the next chapter, we will extend this section with more advanced controls and examples.
Labels are static widgets that represent an object that cannot be modified or selected, and can act like a string, image, or separator. They are usually placed in the left-hand side of the screen to describe text fields, act as separators among non-related fields or to place an image.
The following styles can be selected when you create a label, and can be combined using the |
operator:
SWT.SEPARATOR
: Draws a separatorSWT.HORIZONTAL
: Draws the separator horizontallySWT.VERTICAL
: Draws the separator verticallySWT.SHADOW_IN
: Separator with shadow in effectSWT.SHADOW_OUT
: Separator with...