Appendix B. Component Actions
This appendix lists the various JComponent
descendants and the Action
s you can pull from their respective
ActionMap
s. If the action is bound to a
keystroke via the component’s InputMap
s, 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 ...
Get Java Swing, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.