|
16.6. Beyond Arthur Murray: Actions, Listeners, EventsWith any serious GUI comes a lot of advanced Java, especially constructs like anonymous inner classes. These are useful when we implement actions for our buttons and listeners for user selections. Keep in mind that there are three different time frames that we're consideringcompile time, construction time, and event time. Compile time is obvious, and the compiler will complain if it cannot access what it needs due to scoping problems. Construction time is when the program constructs the GUI objects for display in a window using the new and add() calls as well as layout managers. Event time is when the user presses a button or edits text in a field, or when other external events change data. |
|