Chapter 2. Getting started with SWT and JFace

 

This chapter covers

GUI programming is one of the most rewarding aspects of software development, but when you rely on graphics instead of the command line, there are important questions to be asked. How can your program access the widgets, containers, and events of the operating system? What software classes represent the different components in a GUI, and how can you manipulate them?

The goal of this chapter is to answer the first question and begin answering the second. We’ll discuss the fundamental classes of both the SWT and JFace libraries and how they access operating system resources. This chapter presents two main code examples—HelloSWT.java and HelloSWTJFace.java—that show how to use the Standard Widget Toolkit (SWT) with and without the JFace library. We’ll examine these programs and draw conclusions about their underlying structures.

This chapter will also begin adding code to the WidgetWindow project. This is a graphical interface that will combine all the SWT and JFace topics discussed in this book. We’ll build its frame here and update it in each chapter that follows. Because each chapter adds to this application, we recommend that you follow its development closely.

2.1. Programming in SWT

2.2. Programming in SWT/JFace

2.3. Beginning the WidgetWindow application

2.4. Summary

sitemap