Setting the Shell Title Text

To create professional-looking windows—those that meet the user’s expectations for what a window should look like on a particular platform—it’s not enough to just rely upon the SWT to manage the look and feel of the window. Sure, it will have the same look and feel as other windows running on the platform, but it will still be missing certain elements that users expect to see. One of these elements is the title text, used to tell the user the subject matter of the window contents.

How do I do that?

Every window that opens in an application should have text in the titlebar area. Setting the text is simply a matter of calling the setText( ) method on the Shell class:

s.setText("A Shell Example");

Get SWT: A Developer's Notebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.