Details
-
Bug
-
Resolution: Fixed
-
P3
-
7u17, 8, 9
-
b08
-
os_x
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045529 | 8u25 | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8036754 | 8u20 | Dmitry Markov | P3 | Resolved | Fixed | b07 |
JDK-8053762 | emb-8u26 | Dmitry Markov | P3 | Resolved | Fixed | b17 |
JDK-8036755 | 7u80 | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8060973 | 7u79 | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8057443 | 7u76 | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8050345 | 7u75 | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8044712 | 7u72 | Dmitry Markov | P3 | Closed | Fixed | b01 |
Description
Issue with Java version 7u17 / Mac only.
Add a JComboBox to a JWindow. Show the window from a parent frame. The combo
can be opened, but it does not allow selection from the mouse. The popup
closes on mousePressed, but no selection is made. On other OSes and on Java
1.6 the item is selected correctly on mouseReleased.
Test case:
import java.awt.FlowLayout;
import java.awt.Point;
import java.awt.Window;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JWindow;
import javax.swing.SwingUtilities;
public class TestClass {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(300, 200);
f.setLocationRelativeTo(null);
f.setLayout(new FlowLayout());
final JButton popButton = new JButton("Press me");
popButton.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
Window parentWin =
SwingUtilities.windowForComponent(popButton);
JWindow popup = new JWindow(parentWin);
JPanel panel = new JPanel(new FlowLayout());
panel.add(new JLabel("Cannot Select with Mouse:"));
panel.add(new JComboBox(new String[] { "One", "Two", "Three"
}));
popup.add(panel);
Point p = popButton.getLocationOnScreen();
popup.add(panel);
popup.pack();
popup.setLocation(p.x, p.y + popButton.getHeight());
popup.setVisible(true);
}
});
f.add(popButton);
f.setVisible(true);
}
}
Attachments
Issue Links
- backported by
-
JDK-8036754 [macosx] Cannot select from JComboBox in a JWindow
- Resolved
-
JDK-8036755 [macosx] Cannot select from JComboBox in a JWindow
- Resolved
-
JDK-8045529 [macosx] Cannot select from JComboBox in a JWindow
- Resolved
-
JDK-8050345 [macosx] Cannot select from JComboBox in a JWindow
- Resolved
-
JDK-8053762 [macosx] Cannot select from JComboBox in a JWindow
- Resolved
-
JDK-8057443 [macosx] Cannot select from JComboBox in a JWindow
- Resolved
-
JDK-8060973 [macosx] Cannot select from JComboBox in a JWindow
- Resolved
-
JDK-8044712 [macosx] Cannot select from JComboBox in a JWindow
- Closed
- duplicates
-
JDK-8029686 [macosx] PopupMenu's MenuItem is not fired if the PopupMenu is shown from a JWindow
- Resolved
-
JDK-8041560 JPopupMenu canceled on mouse click without ActionEvent on Mac OS X
- Resolved