Article View: aus.computers.java
Article #208Re: How to notify parent frame?
From: Charles May
Date: Fri, 17 Aug 2001 13:20
Date: Fri, 17 Aug 2001 13:20
30 lines
2622 bytes
2622 bytes
It would be simpler to have your main application gui be the "parent" JFrame and the Options gui be a modal JDialog instead of another JFrame. "Dang Phan" <dangphan@mosca.csse.monash.edu.au> wrote in message news:<9liio0$mov$2@towncrier.cc.monash.edu.au>... > hi, > > I've got a problem like this. > > I have a 'Main' JFrame, which has buttons. I click on 'show Options' button, > another 'Options' JFrame appears. After I have selected all options in > 'Options' JFrame, I then click 'Ok' button or 'Cancel' button. The 'Main' > JFrame needs to know whether I have clicked 'Ok' or 'Cancel' button, ie. it > has to wait until I dispose 'Options' JFrame. > > I have 2 options to solve this problem: > > 1. In 'Main' JFrame, I will have a public function which 'Options' JFrame > will call when I click 'Ok' or 'Cancel' button. In this case, I have to pass > 'this' pointer from 'Main' to 'Options' JFrame. The program will create a > circle, ie. in 'Main' I have one instance of 'Options' and vice versa. > > 2. I'll create a thread in 'Main', and continuously check for existence of > 'Options'. This will consume a lot of resources. > > Can anyone suggest a better solution? Thank you very much for your help. > > Cheers, > Dang.
Technical Details
Message-ID:
<905ad46c.0108170520.16aa6999@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mailReferences:
<9liio0$mov$2@towncrier.cc.monash.edu.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,fa8d12f43d1c0f85 X-Google-Attributes: gid10a146,public X-Google-Thread: f5d71,fa8d12f43d1c0f85 X-Google-Attributes: gidf5d71,public X-Google-Thread: f82aa,fa8d12f43d1c0f85 X-Google-Attributes: gidf82aa,public X-Google-Thread: 10d6db,fa8d12f43d1c0f85 X-Google-Attributes: gid10d6db,public X-Google-Thread: 113ae9,fa8d12f43d1c0f85 X-Google-Attributes: gid113ae9,public X-Google-Thread: 10fd6d,fa8d12f43d1c0f85 X-Google-Attributes: gid10fd6d,public X-Google-ArrivalTime: 2001-08-17 06:20:52 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: charles_n_may@yahoo.com (Charles May) Newsgroups: aus.computers.java,comp.lang.java,comp.lang.java.gui,comp.lang.java.help,comp.lang.java.programmer,it.comp.java Subject: Re: How to notify parent frame? Date: 17 Aug 2001 06:20:51 -0700 Organization: http://groups.google.com/ Lines: 30 Message-ID: <905ad46c.0108170520.16aa6999@posting.google.com> References: <9liio0$mov$2@towncrier.cc.monash.edu.au> NNTP-Posting-Host: 206.150.228.62 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 998054452 23709 127.0.0.1 (17 Aug 2001 13:20:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 17 Aug 2001 13:20:52 GMT