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 without the associated binding if you prefer.

In Tables Table B-1 through Table B-45, you'll find key names with a -P or -R suffix, which stands for "pressed" or "released," respectively. Where you see the arrow keys (up, down, left, right), be aware that some keyboards have two sets of these keys. Either set should work with the bindings listed.

Finally, at the end of this appendix, we list the actions that were introduced as part of the auditory feedback mechanism introduced with SDK 1.4.



Java Swing
Graphic Java 2: Mastering the Jfc, By Geary, 3Rd Edition, Volume 2: Swing
ISBN: 0130796670
EAN: 2147483647
Year: 2001
Pages: 289
Authors: David Geary

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net