O'Reilly logo

Java For Everyone: Compatible with Java 5, 6, and 7, 2nd Edition by Cay Horstmann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required