created: 6/28/99; revised 01/27/00 (using AWT); major revision: 01/10/02 (using Swing); 07/17/06; refurbished 11/02/08
CHAPTER 60 — Swing Text Fields and Labels
This chapter introduces Swing text fields and labels and uses them in a simple Swing program.
Chapter Topics:
- The
JTextFieldSwing component. - The
setText()andgetText()methods ofJTextField. - The
JLabelGUI Component. - Using
ActionListenerfor aJTextField's event. - Example program: text echo program.
- The
setEditable()method ofJTextField.
QUESTION 1:
(Review: ) Say that you have just finished your Swing application. You compile it and start it running. You click on a button and..... nothing happens. What might be wrong?