Chapter 1
Swinging into Swing
In This Chapter
Examining some basic Swing concepts
Fussing with frames
Creating a simple Swing program
Putting panels in your frames
Looking at labels
Beginning with buttons
Leaping into layout
So far in this book, all the programs have been console-based, like something right out of the 1980s. Console-based Java programs have their place, especially when you're just starting with Java. But eventually you'll want to create programs that work with a graphical user interface, also known as a GUI.
This chapter gets you started in that direction. You use a Java GUI package called Swing to create simple GUI applications that display simple buttons and text labels. Along the way, you find out about two key classes: JFrame and JPanel, which provide the visual ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access