Article View: borland.public.jbuilder.java.swing
Article #1367Re: Dialog box association
From: Matthew Sweet
Date: Tue, 16 Dec 2003 17:14
Date: Tue, 16 Dec 2003 17:14
50 lines
3011 bytes
3011 bytes
I've tried that but everything I try to pass out of that getFrame function says it can't be referenced by static context. "Lori M Olson (TeamB)" <javadragon@techie.com> wrote in message news:3fdf342e@newsgroups.borland.com... > Matthew Sweet wrote: > > > That's the problem I'm having. Where I'm creating the dialog box I don't > > know how to get to the Frame class to pass it in. > > > > I'm basically trying to create my own color chooser. Something simple with > > about 8 colors. I have my main frame that instantiates a class extending > > JPanel which in turn instantiates another class extending JPanel and from > > there instantiates the JDialog. I can't get to the Frame component from that > > last JPanel class to pass it into the JDialog class I created. > > > > There's a couple of ways to do this. > > If you think this is going to be a common problem, and you need to have > a way to access that Frame in many places... Then make a static public > method that returns a reference to your frame in your application class > - MyApplication.getFrame() > > Or, if this is an isolated instance, then you can "walk" up the parent > list of your panels, until you get to a parent that is instance of a > JFrame, and use it. > > -- > > Regards, > > Lori Olson (TeamB) > > ------------ > > Save yourself, and everyone else, some time and search the > newsgroups and the FAQ-O-Matic before posting your next > question. > > Google Advanced Newsgroup Search > http://www.google.ca/advanced_group_search > Other Newsgroup Searches: > http://www.borland.com/newsgroups/ngsearch.html > Joi Ellis's FAQ-O-Matic: > http://www.visi.com/~gyles19/fom-serve/cache/1.html >
Technical Details
Message-ID:
<3fdf3e03$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3fde2463@newsgroups.borland.com> <3fde265c$1@newsgroups.borland.com> <3fdf2537$1@newsgroups.borland.com> <3fdf342e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,55c92298dba121d1 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2003-12-16 09:29:00 PST Reply-To: "Matthew Sweet" <matthew.sweet@sed.redstone.army.mil> From: "Matthew Sweet" <matthew.sweet@sed.redstone.army.mil> Newsgroups: borland.public.jbuilder.java.swing References: <3fde2463@newsgroups.borland.com> <3fde265c$1@newsgroups.borland.com> <3fdf2537$1@newsgroups.borland.com> <3fdf342e@newsgroups.borland.com> Subject: Re: Dialog box association Date: Tue, 16 Dec 2003 11:14:58 -0600 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 136.205.73.67 Message-ID: <3fdf3e03$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1071595011 136.205.73.67 (16 Dec 2003 09:16:51 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail