Name: rl43681 Date: 10/20/2003
A DESCRIPTION OF THE PROBLEM :
The documentation on Action Properties on this page is a little misleading. If you look at the arguments for the putValue and getValue methods, they both take a String as the value for the property. This leads readers (like myself) to call the methods like:
putValue("NAME", "blah");
instead of the correct:
putValue(Action.NAME, "blah");
I only realized this after the code didn't work and after clicking on the link to the NAME property; there I could see that this was part of the Action class and maybe I should pass this pre-defined value to the method instead.
It would help if readers were warned of this pitfall. Feel free to use this bug report as an example :) Thanks, and keep up the good work :D
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
This table defines the properties that can be set on an action. The second column lists which components automatically use the properties (and what method is specifically called). For example, setting the ACCELERATOR_KEY on an action that is then attached to a menu item, means that JMenuItem.setAccelerator(KeyStroke) is called automatically. *NOTE: The ACCELERATOR_KEY property (and all other properties) are not to be passed to methods as "ACCELERATOR_KEY", but as Action.ACCELERATOR_KEY*
ACTUAL -
This table defines the properties that can be set on an action. The second column lists which components automatically use the properties (and what method is specifically called). For example, setting the ACCELERATOR_KEY on an action that is then attached to a menu item, means that JMenuItem.setAccelerator(KeyStroke) is called automatically.
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html
(Review ID: 216025)
======================================================================
A DESCRIPTION OF THE PROBLEM :
The documentation on Action Properties on this page is a little misleading. If you look at the arguments for the putValue and getValue methods, they both take a String as the value for the property. This leads readers (like myself) to call the methods like:
putValue("NAME", "blah");
instead of the correct:
putValue(Action.NAME, "blah");
I only realized this after the code didn't work and after clicking on the link to the NAME property; there I could see that this was part of the Action class and maybe I should pass this pre-defined value to the method instead.
It would help if readers were warned of this pitfall. Feel free to use this bug report as an example :) Thanks, and keep up the good work :D
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
This table defines the properties that can be set on an action. The second column lists which components automatically use the properties (and what method is specifically called). For example, setting the ACCELERATOR_KEY on an action that is then attached to a menu item, means that JMenuItem.setAccelerator(KeyStroke) is called automatically. *NOTE: The ACCELERATOR_KEY property (and all other properties) are not to be passed to methods as "ACCELERATOR_KEY", but as Action.ACCELERATOR_KEY*
ACTUAL -
This table defines the properties that can be set on an action. The second column lists which components automatically use the properties (and what method is specifically called). For example, setting the ACCELERATOR_KEY on an action that is then attached to a menu item, means that JMenuItem.setAccelerator(KeyStroke) is called automatically.
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html
(Review ID: 216025)
======================================================================