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

Chapter 5. SWT Text Fields > Adding a Border to a Text Field

5.2. Adding a Border to a Text Field

As you can see from Figure 5-1, a borderless text field is not visually appealing. However, the SWT makes it easy to change the appearance of the text field using additional style attributes. For most applications, you will enhance the text field's appearance by adding a border.

5.2.1. How do I do that?

By now, you should be familiar with how to specify styles for widgets—having used styles for shells, menus, and toolbars. The style that creates a border around a text field is SWT.BORDER, which is passed into the Text constructor in the usual manner:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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