January 2014
Intermediate to advanced
736 pages
70h 43m
English
A button is a component the user clicks to trigger a specific action. A Java app can use several types of buttons, including command buttons, checkboxes, toggle buttons and radio buttons. Figure I.5 shows the inheritance hierarchy of the Swing buttons we cover in this appendix. As you can see, all the button types are subclasses of AbstractButton (package javax.swing), which declares the common features of Swing buttons. In this section, we concentrate on buttons that are typically used to initiate a command.
Fig. I.5 | Swing button hierarchy.
A command button (see Fig. I.7’s output) generates an ActionEvent when the user clicks ...
Read now
Unlock full access