Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMenu Problem

 
Cristian Torrealba
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have a problem with JMenu. I have a JMenuItem called "new". If this item is selected a JFileChooser Dialog is launched. After selecting the file and pressing "open" the JMenu is still open and the "new" Item is selected. But that seems to be only the image that was not repainted or disabled, because I can�t select any items. Only if I press the Menu again, I can reproduce my steps. Does anybody know why it is so and how I can get rid of it?
Thanks in advance
Cristi�n
 
Scott Pedigo
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So did you try putting a repaint() after the call which brings up the dialog to see if that would fix the problem?
 
seetha gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a solution for this. After you select the file dialog box, get the popup menu of the file menuitem and remove it explicitly, by giving setvisible(false). This works fine. Just try it out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic