🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Closing a JFrame from another class

#9187
From: Song Huang
Date: Wed, 10 May 2000 00:00
22 lines
921 bytes
Hello

i have a question about closing a window(JFrame). Let's say:

public class MyGui extends JFrame{//this is a GUI
..............
}

public class UsingMyGui{
...
MyGui mygui = new MyGui();
mygui.setVisible(true);
...
}

Now i want to close this GUI from another class(which doesn't has access
to the mygui variable). How can i do that?

any ideas.
Thanks

Song Huang
Technical Details
Message-ID: <3919CF22.3BAB6561@mindspring.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,46f628b1b7c9f8ec,start
X-Google-Attributes: gid111d45,public
From: Song Huang <songhuang@mindspring.com>
Subject: Closing a JFrame from another class
Date: 2000/05/10
Message-ID: <3919CF22.3BAB6561@mindspring.com>
X-Deja-AN: 621737704
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing