🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7562

Re: I need a window which is modal

#7562
From: Rick Ingham
Date: Fri, 19 Jan 2001 04:40
28 lines
2450 bytes
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: <948gf1$nu85@bornews.inprise.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!feeder.qis.net!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!not-for-mail
References: <3a6369f0_1@dnews> <3a6564c7$1_2@dnews> <944b6j$pcp18@bornews.inprise.com> <3a669326$1_2@dnews>

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-18 20:41:49 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!feeder.qis.net!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!not-for-mail
From: "Rick Ingham" <rdingham@home.com>
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: I need a window which is modal
Date: Thu, 18 Jan 2001 20:40:53 -0800
Organization: Another Netscape Collabra Server User
Lines: 29
Message-ID: <948gf1$nu85@bornews.inprise.com>
References: <3a6369f0_1@dnews>  <3a6564c7$1_2@dnews>  <944b6j$pcp18@bornews.inprise.com>  <3a669326$1_2@dnews>
NNTP-Posting-Host: c191422-a.sttln1.wa.home.com
Mime-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
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