Article View: aus.computers.java
Article #207How to notify parent frame?
From: Dang Phan
Date: Fri, 17 Aug 2001 07:58
Date: Fri, 17 Aug 2001 07:58
24 lines
2371 bytes
2371 bytes
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:
<9liio0$mov$2@towncrier.cc.monash.edu.au>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!feeder.via.net!enews.sgi.com!harbinger.cc.monash.edu.au!towncrier.cc.monash.edu.au!not-for-mailShow 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 00:58:09 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!feeder.via.net!enews.sgi.com!harbinger.cc.monash.edu.au!towncrier.cc.monash.edu.au!not-for-mail From: "Dang Phan" <dangphan@mosca.csse.monash.edu.au> Newsgroups: aus.computers.java,comp.lang.java,comp.lang.java.gui,comp.lang.java.help,comp.lang.java.programmer,it.comp.java Subject: How to notify parent frame? Date: Fri, 17 Aug 2001 17:58:16 +1000 Organization: Monash Uni Lines: 28 Distribution: aus Message-ID: <9liio0$mov$2@towncrier.cc.monash.edu.au> X-Trace: towncrier.cc.monash.edu.au 998035008 23327 130.194.225.8 (17 Aug 2001 07:56:48 GMT) X-Complaints-To: abuse@monash.edu.au X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200