Owl Sams Teach Yourself Java 2 in 24 Hours

Hour 20: Responding to User Events with Swing

NOTES AND CORRECTIONS

  • You can try out a Java 1.02 version of the LottoMadness applet on this site, and also run a souped-up version called LottoRobics.
  • The TextListener interface works for Java 1.02 and 1.1 text fields, but monitoring text changes in Swing requires the use of the DocumentListener interface and the Document class. A new section is being prepared on the use of this interface and will be published on the site so you can complete the hour's second activity.
  • The variable name command is incorrect on Page 324, Line 137. The corrected line is the following:
    • Object item = event.getItem();

SOURCE FILES

READER QUESTIONS

  • None

ACTIVITIES