CHAPTER 10

GRAPHICAL USER INTERFACES image

CHAPTER GOALS

To implement simple graphical user interfaces

To add buttons, text fields, and other components to a frame window

To handle events that are generated by buttons

To write programs that display simple drawings

CHAPTER CONTENTS

10.1 FRAME WINDOWS

Special Topic 10.1: Adding the main Method to the Frame Class

10.2 EVENTS AND EVENT HANDLING

Common Error 10.1: Modifying Parameter Types in the Implementing Method

Common Error 10.2: Forgetting to Attach a Listener

Programming Tip 10.1: Don't Use a Frame as a Listener

Special Topic 10.2: Local Inner Classes

Special Topic 10.3: Anonymous Inner Classes

10.3 PROCESSING TEXT INPUT

10.4 CREATING DRAWINGS

Common Error 10.3: Forgetting to Repaint

Common Error 10.4: By Default, Components Have Zero Width and Height

How To 10.1: Drawing Graphical Shapes

Worked Example 10.1: Coding a Bar Chart Creator image

Video Example 10.1: Solving Crossword Puzzles image

imageIn this chapter, you will learn how to write graphical user-interface applications that contain buttons, text components, and graphical components such as charts. ...

Get Java For Everyone: Compatible with Java 5, 6, and 7, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.