Ticket #23139: scratch_8.java

File scratch_8.java, 797 bytes (added by taylor.smock, 2 years ago)

Minimal reproducer

Line 
1import javax.swing.JFrame;
2import javax.swing.JLabel;
3import javax.swing.JPanel;
4import javax.swing.JPopupMenu;
5
6class MouseDragPopup {
7 public static void main(String[] args) {
8 final JFrame frame = new JFrame("Mouse Drag Popup");
9 final JPanel panel = new JPanel();
10 final JPanel innerPanel = new JPanel();
11 final JPopupMenu menu = new JPopupMenu();
12 menu.add("This should not appear (and does not under Linux/Windows)");
13 innerPanel.setComponentPopupMenu(menu);
14 panel.add(new JLabel("Right click and drag from here"));
15 panel.add(innerPanel);
16 panel.add(new JLabel("to here"));
17 frame.add(panel);
18 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
19 frame.pack();
20 frame.setVisible(true);
21 }
22}