Lesson 9. Creating a Graphical User Interface

Most computer users today expect software to feature a graphical user interface (GUI) with a variety of widgets such as text boxes, sliders, and scrollbars. The Java Class Library includes Swing, a set of packages that enable Java programs to offer a sophisticated GUI and collect user input with the mouse, keyboard, and other input devices.

In this lesson, you will use Swing to create applications that feature these GUI components:

  • Frames: Windows with a title bar; menu bar; and Maximize, Minimize, and Close buttons

  • Containers: Components that hold other components

  • Buttons: Clickable rectangles with text or graphics indicating their purpose

  • Labels: Text or graphics that provide information

  • Text ...

Get Sams Teach Yourself Java in 21 Days (Covers Java 11/12), 8th 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.