In order to avoid the overhead of individual event-listeners for every button or menu-item, my application uses a central ActionListener which uses ActionEvent.getActionCommand() to distinguish between the several (hundred) event sources. Unfortunately, ActionEvents created by Swing components in libgcj always return null for getActionCommand(). Testing with the JDKs (1.1 .. 5.0) reveals, that the JDKs return getText() for standard AbstractButtons like JButton or JMenuItem. I suggest that gcj also returns the value of getText() for these components. See attached testcase; compile and run with gcj and a JDK/JRE for comparison.
Created attachment 8156 [details] testcase for the bug, run with gcj and java for comparison.
Confirmed.
I have checked in a fix for this some days ago on GNU Classpath CVS. If that is merged into GCJ, this could be closed.
Fixed. Closing.