-
Bug
-
Resolution: Fixed
-
P1
-
7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8006418 | 8 | Anton Litvinov | P1 | Closed | Fixed | b75 |
JDK-8018756 | 7u45 | Anton Litvinov | P1 | Closed | Fixed | b01 |
JDK-8010621 | 7u25 | Anton Litvinov | P1 | Closed | Fixed | b03 |
JDK-8009413 | 7u21 | Anton Litvinov | P1 | Closed | Fixed | b05 |
JDK-8009343 | 7u17 | Anton Litvinov | P1 | Resolved | Fixed | b31 |
JDK-8008155 | 7u15 | Anton Litvinov | P1 | Closed | Fixed | b31 |
JDK-8008147 | 7u11 | Edvard Wendelin | P1 | Resolved | Fixed | b33 |
JDK 7u9
ADDITIONAL OS VERSION INFORMATION :
Apple Mac OS X 10.7 (Intel) (64-bit)
A DESCRIPTION OF THE PROBLEM :
An immediate call to JComboBox.showPopup() after JComboBox.hidePopup() does not lead to showing of a popup menu in JDK 7 on OS X, instead of this the popup menu just flashes. However the popup menu is always shown in JDK 6.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run the attached source code.
2. Click into any place of a displayed frame.
REPRODUCIBILITY :
The bug is reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class TestWTDComboBox {
static JComboBox kb = null;
static boolean dataPopulated = false;
static AWTEvent event = null;
static JFrame frame;
public static void main(String[] args) {
frame = new JFrame("Creating a JComboBox Component");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 400);
JPanel panel = new JPanel();
String anArray[] = {"BCA", "MCA", "PPC", "CIC"};
kb = new JComboBox(anArray) {
@Override
public void showPopup() {
if (!dataPopulated) {
frame.dispatchEvent(event);
}
super.showPopup();
}
};
kb.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
System.out.println("hello");
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
kb.setPopupVisible(false);
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {}
});
panel.add(kb);
frame.add(panel);
frame.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
System.out.println("hello111");
event = e;
test();
}
@Override
public void mousePressed(MouseEvent e) {
System.out.println("hello111");
event = e;
test();
}
@Override
public void mouseReleased(MouseEvent e) {
System.out.println("hello111");
}
@Override
public void mouseEntered(MouseEvent e) {
System.out.println("hello111");
}
@Override
public void mouseExited(MouseEvent e) {
System.out.println("hello111");
}
});
SwingUtilities.invokeLater(new Runnable() {
public void run() {
frame.setVisible(true);
}
});
}
public static void test() {
Object prevSel = kb.getSelectedItem();
boolean isDropDown = kb.isPopupVisible();
kb.hidePopup();
kb.removeAllItems();
kb.addItem("none");
kb.addItem("none1");
kb.addItem("none2");
kb.addItem("none3");
dataPopulated = true;
kb.setSelectedItem(prevSel);
kb.showPopup();
dataPopulated = false;
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8008147 JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-
- Resolved
-
-
JDK-8009343 JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-
- Resolved
-
-
JDK-8006418 JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-
- Closed
-
-
JDK-8008155 JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-
- Closed
-
-
JDK-8009413 JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-
- Closed
-
-
JDK-8010621 JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-
- Closed
-
-
JDK-8018756 JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
-
- Closed
-