CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 1999
    Location
    Pacific Ocean, Deep Blue Sea
    Posts
    133

    can't show Jpopupmenu

    hi,
    i want to show a JPopupmenu when i right click a cell in a JTable. i traced the program and found it failed at the show method.

    obj.DbugFile.println("exeucted 1 ?"+e.getX()+" "+e.getY());
    popupMenu.show(table, e.getX(), e.getY());
    obj.DbugFile.println("exeucted 2 ?");



    the log file shows "executed 1" is printed but "executed 2" is not.

    this is my popupmenu class

    class PopupMenu extends JPopupMenu {
    public JMenuItem myMenuItem ;
    public PopupMenu() {
    add(myMenuItem = CreatePopupMenuComponents("my Management", "ACTION_PROPERTIES", 'R',this));
    }
    private JMenuItem createPopupMenuComponents(String menuName, String actionCommand, int mnemonic, java.lang.Object listener) {
    JMenuItem menuItem = new JMenuItem(menuName);
    menuItem.setActionCommand(actionCommand);
    menuItem.setMnemonic(mnemonic);
    menuItem.addActionListener((ActionListener)listener);
    return menuItem;
    }

    }




    pls help ...(cry...)

    Signature (up to 100 characters) You may use Markup in your signature

  2. #2
    Join Date
    Jan 2000
    Location
    CA, USA
    Posts
    305

    Re: can't show Jpopupmenu

    Hi Mr. Chang,
    I hope the solution I gave you was useful.

    Please rate it so that people can get encouraged.

    Thanks
    Kannan



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured