bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/23022] JMenuItem getActionCommand should not return null


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/23022] JMenuItem getActionCommand should not return null
Date: 8 Sep 2010 18:04:52 -0000

I have an application that uses the string returned by
JMenuItem.getActionCommand() to index into a Hashtable
and then to dispatch to individual actions via reflection.

The JDK returns the current JMenuItem label/text in getActionCommand() until
setActionCommand() is called with
some other value. Classpath returns null, which breaks my app.

Could someone with FSF paperwork please add a corresponding
fix to JMenuItem (constructors) or should this go into
AbstractButton?
A similar workaround is already used in java.awt.MenuItem.


------- Comment #1 from from-classpath at savannah dot gnu dot org  2005-07-05 
18:58 -------
This looks like a duplicate of bug 13534


------- Comment #2 from from-classpath at savannah dot gnu dot org  2005-07-14 
23:07 -------
Hm, no this is not a duplicate of bug #13534 since it involves the component
directly and not an actionevent created from it (or it's model).

A recent patch from Roman Kennke an me fixed the problem described here.
AbstractButton (and known subclasses) will now return the label/text if no
proper actioncommand is set or the empty string in case that the label is null.

Fixed in CVS (will be released with 0.17).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23022




reply via email to

[Prev in Thread] Current Thread [Next in Thread]