I'm using a JPopUpMenu and once it is showed, If I want to show it again without selecting any item, neccesarly I have to select one menu item or at least, click in any other part of the component associated to the JPopUpMenu,
so, it seems, that once a JPopUpMenu is showed, then after two clicks the JPopUp will be showed again, I would like to show the JPopUpMenu everytime is clicked in my panel (I will put the code), without selecting any menu item. import javax.swing.*; import javax.swing.event.*;
private class ManejadorEdicion implements ActionListener { public void actionPerformed( ActionEvent e ) { public void actionPerformed( ActionEvent e ) { if (e.getSource() == cut) System.out.println("Accion cortar ..."); } }
private class ManejadorMouseClicks extends MouseAdapter { public void mousePressed (MouseEvent e) { System.out.println("Hello ...!, let's show the popup"); popup.show(e.getComponent(), e.getX(), e.getY()); } } }
and finally the .html file,
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width ="800" height="500" align="baseline" codebase = "http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0" > <PARAM NAME = "code" VALUE = "MyApplet.class"> <PARAM NAME = "type" VALUE = "application/x-java-applet;version=1.2"> </OBJECT>