Article View: borland.public.jbuilder.java.swing
Article #7575Re: I need a window which is modal
From: HABA
Date: Fri, 19 Jan 2001 22:19
Date: Fri, 19 Jan 2001 22:19
56 lines
3189 bytes
3189 bytes
thanks for your help, but i need a real modal jwindow which stops all other prozesses "Rick Ingham" <rdingham@home.com> schrieb im Newsbeitrag news:948o7v$nnm5@bornews.inprise.com... > This made me curious enough, I just had to figure it out. Here is both a ModalWindow and ModalFrame that extend JWindow and JFrame. > > Once you invoke show() or setVisible(true), the calling thread will block in a thread wait, so make sure you have an action on the > window that will invoke hide() or setVisible(false) to unblock and notify() the original thread. > > "Rick Ingham" <rdingham@home.com> wrote in message news:948gf1$nu85@bornews.inprise.com... > > Sorry, I keep forgetting to bring home a code snippit. > > > > After I opened my big mouth, I realized mine is only a way to make the thread modal. It pauses the thread calling > setVisible(true) > > or show() putting it into a thread wait(). Then an action event of some kind within the window will do a notify() to rekindle the > > sleeping thread. That's only part of the modal behavior of a Dialog. > > > > It doesn't make the parent window unavailable or disabled, nor does it force the pseudo dialog window to come to the front when > any > > of the parent hierarchy is selected. > > > > I think this can be done by registering a FocusListener with each of the parent components and calling toFront if focusGained() is > > invoked while the modal window is visible. > > > > If you still need more, I'll try to put something like this together as an example for you. > > "Torsten Welches" <torsten.welches@who.cares.netcologne.de> wrote in message news:3a669326$1_2@dnews... > > > > > > Rick, > > > > > > interesting! Would you mind to post some info/snippets about it? > > > I guess you mean something like reimplementing Dialog - > > > including your own ui-event pump and so on. > > > I always thought this still wasn't possible without a true modal > > > (native/peer) window component. > > > > > > Torsten > > > > > > "Rick Ingham" <rdingham@home.com> wrote: > > > >I did this once using thread synchronization and an overridden show()/hide() that called wait()/notify(). > > > > > >
Technical Details
Message-ID:
<3a68bcad_2@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.cwix.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!62.157.19.209References:
<3a6369f0_1@dnews> <3a6564c7$1_2@dnews> <944b6j$pcp18@bornews.inprise.com> <3a669326$1_2@dnews> <948gf1$nu85@bornews.inprise.com> <948o7v$nnm5@bornews.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,4562037466fa7b2c X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2001-01-19 14:22:02 PST From: "HABA" <The.HABA@t-online.de> Newsgroups: borland.public.jbuilder.java.swing References: <3a6369f0_1@dnews> <3a6564c7$1_2@dnews> <944b6j$pcp18@bornews.inprise.com> <3a669326$1_2@dnews> <948gf1$nu85@bornews.inprise.com> <948o7v$nnm5@bornews.inprise.com> Subject: Re: I need a window which is modal Date: Fri, 19 Jan 2001 23:19:46 +0100 Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 62.157.19.209 Message-ID: <3a68bcad_2@dnews> X-Trace: 19 Jan 2001 14:16:13 -0800, 62.157.19.209 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.cwix.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!62.157.19.209