-
Enhancement
-
Resolution: Won't Fix
-
P4
-
1.2.0, 6
-
x86
-
windows_nt, windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8007723 | 8 | Vladislav Karnaukhov | P2 | Closed | Fixed | b78 |
JDK-8018639 | 7u45 | Vladislav Karnaukhov | P4 | Closed | Fixed | b01 |
JDK-8007724 | 7u40 | Vladislav Karnaukhov | P2 | Closed | Fixed | b16 |
Name: dbT83986 Date: 12/23/98
When the user pops up a JComboBox (hits the
spacebar for Metal L&F), and then tries to
navigate with the arrow keys, any ActionListeners
for that CB will have their actionPerformed
methods called, and there isn't any information in
the given ActionEvent to show that this was only a
navigation action rather than a selection
(spacebar) action.
Source:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class inc37498 extends JFrame
{
public inc37498()
{
try {UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); }
catch (Exception e) {System.out.println("L&F error"); }
String[] items = {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5"};
JComboBox cb = new JComboBox(items);
getContentPane().add(cb);
cb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getID() == ActionEvent.ACTION_PERFORMED) {
System.out.println("CB action performed:" + e);
} else {
System.out.println("CB action:" + e);
}
}
});
pack();
}
public static void main(String[] args)
{
new inc37498().show();
}
}
(Review ID: 37498)
======================================================================
###@###.### 10/12/04 18:24 GMT
When the user pops up a JComboBox (hits the
spacebar for Metal L&F), and then tries to
navigate with the arrow keys, any ActionListeners
for that CB will have their actionPerformed
methods called, and there isn't any information in
the given ActionEvent to show that this was only a
navigation action rather than a selection
(spacebar) action.
Source:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class inc37498 extends JFrame
{
public inc37498()
{
try {UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); }
catch (Exception e) {System.out.println("L&F error"); }
String[] items = {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5"};
JComboBox cb = new JComboBox(items);
getContentPane().add(cb);
cb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getID() == ActionEvent.ACTION_PERFORMED) {
System.out.println("CB action performed:" + e);
} else {
System.out.println("CB action:" + e);
}
}
});
pack();
}
public static void main(String[] args)
{
new inc37498().show();
}
}
(Review ID: 37498)
======================================================================
###@###.### 10/12/04 18:24 GMT
- backported by
-
JDK-8007723 RFE: JComboBox shouldn't sending ActionEvents for keyboard navigation
-
- Closed
-
-
JDK-8007724 RFE: JComboBox shouldn't sending ActionEvents for keyboard navigation
-
- Closed
-
-
JDK-8018639 RFE: JComboBox shouldn't sending ActionEvents for keyboard navigation
-
- Closed
-