JPopUpMenu
I am trying to extends JPopUpMenu
hee is my code
publicclass RightClickMenuextends JPopupMenu
{
public RightClickMenu(JComponent aComp,int x,int y)
{
this.show(aComp, x, y);
theComp = aComp;
JMenuItem copy =new JMenuItem("CopyCtrl C");
copy.addActionListener(new CopyListener());
JMenuItem copyLine =new JMenuItem("Copy LineCtrl L");
copyLine.addActionListener(new CopyLineListener());
JMenuItem paste =new JMenuItem("PasteCtrl V");
paste.addActionListener(new PasteListener());
if(aCompinstanceof MyTable)
{
this.add(copy);
this.add(copyLine);
this.add(paste);
}
else
{
this.add(copy);
this.add(paste);
}
}
private JComponent theComp;
}
is there a reason why when i create new instance of this class nothing will appears on the screen.
did i forget something? is the method .show(aComp, ax, ay) enougth to pop up the jpopupmenu ?

