O'Reilly logo

Java Swing, 2nd Edition by Brian Cole, James Elliott, Marc Loy, Robert Eckstein, Dave Wood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Component Actions

This appendix lists the various JComponent descendants and the Actions you can pull from their respective ActionMaps. If the action is bound to a keystroke via the component’s InputMaps, those associations are listed for the Metal and Mac L&Fs. The Windows and Motif L&Fs are quite similar to the Metal L&F, but if you want the definitive list, you should also check out the API document on this topic (<yourJavaDocDir>/api/javax/swing/doc-files/Key-Index.html or the online copy of the docs (http://java.sun.com/j2se/1.4/docs/).

It’s important to remember that there are three input maps associated with a component—one for each of three focus states. If you recall from Chapter 3, the possibilities are WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, and WHEN_IN_FOCUSED_WINDOW. The titles of the tables indicate which state the table describes.

The information in this appendix is largely based on SDK 1.4, but the Mac L&F reflects the 1.3.1 release of the SDK on OS X. Some components did not exist until 1.4. Some actions are bound in 1.4 that are not bound in 1.3 (rarely vice versa, although some unbound actions did exist in 1.3 that are no longer part of 1.4). Because of this variability, we are including our Mapper application (Mapper.java in the utilities available on the book’s web site). You can run the application, type in a class, choose the input map condition, and grab a current set of bound actions. You can also see the InputMap or the ActionMap ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required