-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
beta
-
generic, x86
-
generic, windows_nt
Name: yyT116575 Date: 10/27/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The constructor of JButton that takes an action ignores the MNEMONIC_KEY if it
is specified. The following code should display a line under the 'p' but it
doesn't.
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class Test {
public static void main( final String args[] ) {
final AbstractAction action = new AbstractAction() {
public void actionPerformed( final ActionEvent event ) {
// Do nothing
}
};
final JFrame frame = new JFrame("Toolbar tester");
frame.getContentPane().setLayout( new FlowLayout() );
action.putValue( Action.NAME, "Push me" );
action.putValue( Action.MNEMONIC_KEY, new Integer((int)'p') );
frame.getContentPane().add( new JButton(action) );
frame.setSize(400,200);
frame.show();
}
}
(Review ID: 110939)
======================================================================
- duplicates
-
JDK-4347339 JMenuItem doesn't extract tooltip text from its action object
-
- Closed
-