java - JMenu's pop-up will not close when the cursor leaves the JMenu -


jbutton jbutton1 = new jbutton("click me");  public void showpopupmenu1(jbutton invoker){     jpopupmenu popupmenu = new jpopupmenu();     popupmenu.setlayout(new gridlayout(5, 1));     jmenu menu = new jmenu("other");     menu.add(new jmenuitem("a"));     menu.add(new jmenuitem("b"));     menu.add(new jmenuitem("c"));     popupmenu.add(menu);     popupmenu.add(new jbutton("apple"));     popupmenu.add(new jbutton("banana"));     popupmenu.add(new jbutton("carrot"));     popupmenu.add(new jbutton("orange"));     popupmenu.show(invoker, 0, invoker.getheight()); }  private void jbutton1actionperformed(java.awt.event.actionevent evt)  {                                              showpopupmenu1(jbutton1); } 

when cursor goes apple button, menu's popup not close , still marked selected.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -