Results 1 to 4 of 4
  1. #1
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default JPopupMenu not responding

    Hi Java fans,

    I have a pickle situation. So I have this RightClickMenu object which extends JPopupMenu.

    Java Code:
    package GUI;
    
    import javax.swing.*;
    
    public class RightClickMenu extends JPopupMenu {
    
        private final static JMenu set_stage = new JMenu("Set Stage");
    
        public RightClickMenu() {
    
            super();
    
            JMenuItem set_warranty = new JMenuItem("Set Warranty");
    
            JMenuItem print_ber = new JMenuItem("Print BER");
    
            JMenuItem print_documentation = new JMenuItem("Print Documentation");
    
            JMenuItem add_quick_note = new JMenuItem("Add Quick Note");
    
            JMenuItem view_order = new JMenuItem("View Order");
    
            createStages();
    
            addSeparator();
            add(set_stage);
            add(set_warranty);
            add(print_ber);
            add(print_documentation);
            add(add_quick_note);
            add(view_order);
        }
    
        private static void createStages() {
    
            JMenuItem letter_sent = new JMenuItem(OrderV2.LETTER_SENT);
    
            JMenuItem console_received = new JMenuItem(OrderV2.CONSOLE_RECEIVED);
    
            JMenuItem console_repaired = new JMenuItem(OrderV2.CONSOLE_REPAIRED);
    
            JMenuItem console_posted = new JMenuItem(OrderV2.CONSOLE_POSTED);
    
            JMenuItem quarantine = new JMenuItem(OrderV2.QUARANTINE);
    
            JMenuItem quarantine_to_invoice = new JMenuItem(OrderV2.QUARANTINETOINVOICE);
    
            JMenuItem ber = new JMenuItem(OrderV2.BER);
    
            set_stage.add(letter_sent);
            set_stage.add(console_received);
            set_stage.add(console_repaired);
            set_stage.add(console_posted);
            set_stage.add(quarantine);
            set_stage.add(quarantine_to_invoice);
            set_stage.add(ber);
        }
    }
    It does get displayed when needed and all that - but. If I hover over the JMenuItems, they do not change background color to blue as a selected item. I had action listeners added to some of the items to see if responds to anything and it did print out stuff when items get clicked.

    Thanks for your responses.

    Flynn
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

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

    Default

    To get better help sooner, post a SSCCE that clearly demonstrates your problem.

    db

  3. #3
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Ah... that does make more sense :)
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default

    I don't see any ActionListener being added to any JMenuItem at all; how is this thing supposed to do anything?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Responding to clicks outside a window
    By bayan in forum New To Java
    Replies: 6
    Last Post: 06-14-2010, 04:51 PM
  2. Focus traversal keys not responding
    By javaexplorer in forum AWT / Swing
    Replies: 1
    Last Post: 02-16-2010, 08:52 AM
  3. JPopupMenu
    By hungleon88 in forum NetBeans
    Replies: 8
    Last Post: 01-15-2009, 05:00 PM
  4. Responding to button presses
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 07:38 PM
  5. Replies: 0
    Last Post: 06-03-2008, 11:26 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
  •