Results 1 to 2 of 2
  1. #1
    Scyth3 is offline Member
    Join Date
    Nov 2012
    Posts
    12
    Rep Power
    0

    Unhappy JPopupMenu, adding menu items.

    When I add menu items, they don't show up when I hover over the menu in the JPopupMenu


    Java Code:
        JPopupMenu p = new JPopupMenu("Menu");
        JMenu menu = new JMenu("File");
    static JMenuItem close = new JMenuItem("Close");
    Java Code:
                p.add(menu);
                menu.addSeparator();
                menu.add(close);

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: JPopupMenu, adding menu items.

    Why on earth is the MenuItem static? Chances are it's been added to some other container or even the same popup in another instance of the class, and that's why it's not showing.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Struts menu items delay
    By seol_sensei in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 05-31-2011, 01:20 AM
  2. override the menu items
    By trishtren in forum AWT / Swing
    Replies: 0
    Last Post: 05-19-2011, 11:46 PM
  3. ActionListener for Menu Items
    By CuddlyKittens11 in forum AWT / Swing
    Replies: 7
    Last Post: 04-22-2011, 06:10 AM
  4. folder/file menu items
    By jhughes in forum Advanced Java
    Replies: 2
    Last Post: 07-21-2009, 10:57 PM
  5. hyperlinks from menu items?
    By asterope118 in forum New To Java
    Replies: 1
    Last Post: 07-16-2007, 01:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •