🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11884

File | Exit CANNOT call setVisible(false)!

#11884
From: Max Polk
Date: Tue, 09 Mar 1999 00:00
16 lines
1077 bytes
I set up an action listener on the menu option File | Exit.  In it, I had 
it do a setVisible(false).

I had a component listener that did a dispose() when it saw a component 
hidden.

The only problem is that you get disposed before the menu can redraw, so 
I get this bizarre message (JDK 1.1.7B) that said something like 
"received mouse event on hidden component."

I had no choice but to do a SwingUtilities.invokeLater and in it, have it 
do a setVisible(false).  That way, the menu bar got a chance to redraw 
before the window closes.

Has anyone else had to DELAY acting on menu items because the menu itself 
needs time to redraw?
Technical Details
Message-ID: <MPG.114f90543fff483b9896c6@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,a039e9e9bca69501,start
X-Google-Attributes: gid111d45,public
From: none@none.invalid (Max Polk)
Subject: File | Exit CANNOT call setVisible(false)!
Date: 1999/03/09
Message-ID: <MPG.114f90543fff483b9896c6@forums.borland.com>
X-Deja-AN: 453203690
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing