-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0, 1.2.2
-
beta
-
generic, x86
-
generic, windows_nt
Name: rk38400 Date: 05/12/98
JComboBox does not get focus events when using Metal L&F -- It seems to work fine ith other Lokk and Feels.
Here's a sample:
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
public class Main extends JFrame {
public Main() {
JComboBox comboBox = new JComboBox();
comboBox.addItem("One");
JTextField textField = new JTextField(20);
getContentPane().setLayout(new FlowLayout());
getContentPane().add(comboBox);
getContentPane().add(textField);
comboBox.addFocusListener(new FocusListener() {
public void focusLost(FocusEvent fe) {
System.out.println("focus LOST");
}
public void focusGained(FocusEvent fe) {
System.out.println("focus GAINED");
}
});
}
public static void main(String[] args) {
try{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.metal.MetalLookAndFeel");
}
catch (Exception e) {
System.exit(0);
}
JFrame frame = new Main();
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});
frame.pack();
frame.setVisible(true);
}
}
(Review ID: 30190)
======================================================================
- duplicates
-
JDK-4303704 MetalComboBoxUI always reports isFocusTraversable as false.
-
- Closed
-