Click to See Complete Forum and Search --> : can't show Jpopupmenu


Zerg
May 8th, 2000, 12:23 AM
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

kannanbalu
May 11th, 2000, 01:02 PM
Hi Mr. Chang,
I hope the solution I gave you was useful.

Please rate it so that people can get encouraged.

Thanks
Kannan