-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta3
-
x86
-
windows_2000
Name: rmT116609 Date: 09/04/2001
java version "1.4.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)
An editable JComboBox with the popup visible doesn't hide the popup when the
user presses the tab key and focus goes elsewhere.
Example.
Compile and run the attached program.
Press the down key to open the popup.
Press the tab key.
Result: focus goes to the textfield, but the combobox popup is still visible.
package pt.keysoft;
import java.awt.FlowLayout;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class TestBug extends JFrame {
public TestBug(String name) {
super(name);
JPanel panel = new JPanel(new FlowLayout());
getContentPane().add(panel);
JComboBox combobox = new JComboBox(new Object[] {"First", "Second", "Third", "Number 4", "And Five"});
combobox.setEditable(true);
panel.add(combobox);
panel.add(new JTextField(10));
}
public static void main(String[] args) {
TestBug test = new TestBug("TestBug");
test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
test.pack();
test.setLocation(100, 70);
test.setVisible(true);
}
}
(Review ID: 131217)
======================================================================