i made a simple code to make JFrame and add popup menu to it
when i clicked on the menu item, popup menu become invisible
what's the problem ?Code:public static void main(String[] args) {
JFrame f = new JFrame();
f.setSize(400, 500);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
JPopupMenu p = new JPopupMenu("x");
p.add(new JMenuItem("new"));
p.add(new JMenuItem("cut"));
f.show();
p.show(f, 50, 50);
}

