-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
x86
-
generic
This happens in Win platforms only in the case of a JComboBox with a heavy-weight dropdown list and using keyboard. It works okay with light/medium weight dropdown lists and using mouse.
To reproduce:
------------------
Run the attached program. The JComboBox can be seen having the focus on it. Hit 'Enter' key to bring down the dropdown list. Now the JComboBox will have lost its focus. Hitting the 'Enter' key will not take the dropdown list back up. Hitting 'Esc' takes the dropdown list back up, but the JComboBox never gains the focus back.
Code used:
---------
import java.awt.*;
import java.util.*;
import javax.swing.*;
public class testCombo extends JPanel {
JComboBox combo;
public testCombo() {
setPreferredSize(new Dimension(100, 50));
Vector data = new Vector();
for (int i = 0;i < 100;i++)
data.addElement(new Integer(i));
combo =new JComboBox(data);
combo.setMaximumRowCount(5);
add(combo);
}
public static void main(String args[]) {
JFrame frame = new JFrame("Combo Test");
testCombo t = new testCombo();
frame.getContentPane().add(t);
frame.pack();
frame.setVisible(true);
}
}
To reproduce:
------------------
Run the attached program. The JComboBox can be seen having the focus on it. Hit 'Enter' key to bring down the dropdown list. Now the JComboBox will have lost its focus. Hitting the 'Enter' key will not take the dropdown list back up. Hitting 'Esc' takes the dropdown list back up, but the JComboBox never gains the focus back.
Code used:
---------
import java.awt.*;
import java.util.*;
import javax.swing.*;
public class testCombo extends JPanel {
JComboBox combo;
public testCombo() {
setPreferredSize(new Dimension(100, 50));
Vector data = new Vector();
for (int i = 0;i < 100;i++)
data.addElement(new Integer(i));
combo =new JComboBox(data);
combo.setMaximumRowCount(5);
add(combo);
}
public static void main(String args[]) {
JFrame frame = new JFrame("Combo Test");
testCombo t = new testCombo();
frame.getContentPane().add(t);
frame.pack();
frame.setVisible(true);
}
}
- duplicates
-
JDK-4407702 Heavyweight Popup in the Combo box should not get focus for keyboard navigation
- Closed