jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes JMenu Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JMenu Problem" Watch "JMenu Problem" New topic

JMenu Problem

Cristian Torrealba

Joined: Sep 21, 2000
Posts: 10
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
Scott Pedigo

Joined: Feb 15, 2001
Posts: 15
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

Joined: Feb 12, 2001
Posts: 4
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
I agree. Here's the link: http://aspose.com/file-tools
subject: JMenu Problem
It's not a secret anymore!