Results 1 to 4 of 4
Thread: popup menu
- 09-17-2010, 08:07 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 61
- Rep Power
- 0
popup menu
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 ?Java 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); }
- 09-17-2010, 11:56 PM #2
- 09-18-2010, 03:15 AM #3
i think, instead of making the popup menus show initially there, you might want to have an event handler on the main window, such as a mouse click event , or a main menu, to cause the popup menus to be displayed,?
- 09-18-2010, 01:44 PM #4
Similar Threads
-
tray popup menu
By newbiejava in forum New To JavaReplies: 1Last Post: 01-11-2010, 07:05 PM -
js popup menu problem
By webdreamer in forum New To JavaReplies: 2Last Post: 11-16-2009, 08:50 PM -
How can I add popUp menu on a tab of a tabbedPane?
By shahid0627 in forum AWT / SwingReplies: 1Last Post: 08-31-2009, 04:19 AM -
add PopUp menu by NetBeans
By hungleon88 in forum AWT / SwingReplies: 1Last Post: 09-12-2008, 01:05 PM -
how to create Popup Menu with Sub Menu while right-clicking the JTree Node??
By Kabiraa in forum AWT / SwingReplies: 7Last Post: 05-09-2008, 07:54 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks