Chapter 17. Using Swing Components

In the previous chapter, we discussed a number of concepts, including how Java’s user interface facility is put together and how the fundamental pieces work. You should understand components and containers and how they work together to create a display, events and how components use them to communicate with the rest of your application, and layout managers.

Now that we’re done reviewing general concepts and background, we’ll get to the fun stuff: how to do things with Swing. We will cover most of the components that the Swing package supplies, how to use these components in applets and applications, and how to build your own components. We will have lots of code and lots of pretty examples to look at.

There’s more material on this topic than fits in a single chapter. In this chapter, we’ll cover all the basic user interface components. In the next chapter, we’ll cover some of the more involved topics: text components, trees, tables, and creating your own components.

Get Learning Java, 4th Edition 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.