🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #206

How to notify parent frame?

#206
From: DP
Date: Fri, 17 Aug 2001 07:48
24 lines
2424 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: <9lii69$lpl$1@towncrier.cc.monash.edu.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!enews.sgi.com!harbinger.cc.monash.edu.au!towncrier.cc.monash.edu.au!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10fd6d,fa8d12f43d1c0f85,start
X-Google-Attributes: gid10fd6d,public
X-Google-Thread: f82aa,fa8d12f43d1c0f85,start
X-Google-Attributes: gidf82aa,public
X-Google-Thread: f5d71,fa8d12f43d1c0f85,start
X-Google-Attributes: gidf5d71,public
X-Google-Thread: 10a146,fa8d12f43d1c0f85,start
X-Google-Attributes: gid10a146,public
X-Google-Thread: 113ae9,fa8d12f43d1c0f85,start
X-Google-Attributes: gid113ae9,public
X-Google-Thread: 10d6db,fa8d12f43d1c0f85,start
X-Google-Attributes: gid10d6db,public
X-Google-ArrivalTime: 2001-08-17 00:47:27 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!enews.sgi.com!harbinger.cc.monash.edu.au!towncrier.cc.monash.edu.au!not-for-mail
From: "DP" <Dang@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:48:48 +1000
Organization: Monash Uni
Lines: 26
Distribution: aus
Message-ID: <9lii69$lpl$1@towncrier.cc.monash.edu.au>
X-Trace: towncrier.cc.monash.edu.au 998034441 22325 130.194.225.8 (17 Aug 2001 07:47:21 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