creation: 6/28/99; revised 01/27/00

CHAPTER 59 --- Example GUI Application

The three parts of a GUI application are:

  1. Components that make up the Graphical User Interface.
  2. Listeners that receive the events and respond to them.
  3. Application code that does useful work for the user. <---- finally we'll do this, at least a little

In this chapter we will create a simple application that involves all three GUI parts.

Chapter Topics:

  • The TextField GUI Component.
  • The setText() and getText() methods of TextField.
  • The Label GUI Component.
  • Using ActionListener for a TextField's event.
  • Example program: text echo program.
  • The setEditable() method of TextField.

QUESTION 1:

(Review: ) Say that you have just finished your GUI application. You compile it and start it running. You click on a button in the GUI and..... nothing happens. What might be wrong?

Click Here after you have answered the question