Text is a selectable user interface objects that allow the user to enter and modify text. Events associated with Text are: DefaultSelection, Modify, Verify. Different Text styles are CENTER, LEFT, MULTI, PASSWORD, SINGLE, RIGHT, READ_ONLY, WRAP. Please note that only one of the styles MULTI and SINGLE may be specified.
The following are the important constructors of Text class.
Text(Composite parent, int style)
Constructs a new instance of this class given its
In order to work with events in SWT, you create a listener specific to the event that you wish to capture. There is an interface for each listener that you can use (for example SelectionListener). There is also a class that will provide you with the event information (for example SelectionEvent). Within the listener that you create, you must implement the methods defined in the interface. Java Code: SelectionListener listener = new SelectionListener()
SelectionListener listener = new SelectionListener()