• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PupMenu

 
Herbert Maosa
Ranch Hand
Posts: 289
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hie, folks
I am new on this forum and I hope my subject does fall in the right place. I was trying to attach PopupMenus to a component in an applet. I can do this quite oky, but I have a problem getting rid of the popmenu. To show it I am basically using the show() method of the Popupclass, but I just can not find a method to get rid of it when I am done with it. Could someone help ?
 
Tom P
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about setVisible(false)
 
Herbert Maosa
Ranch Hand
Posts: 289
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom,
Apparently PopupMenu has three methods only and setVisible() is not one of them. I think this method is from the Component class and PopupMenu does not descend from this heirachy, so it does not inherit it.
Herbert.
 
Tom P
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I was thinking of the JPopupMenu which does support setVisible(). The PopupMenu is designed to stay visible until the user clicks anywhere outside of the PopupMenu. There is no way to hide it once it is displayed.
 
Pawel Veselov
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more idea - since PopupMenu is a grandchild of a MenuComponent you can post some event to make it disappear. Just a suggeston.
 
Tom P
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could delete all the menu items from the PopupMenu.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic