🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How to refocus an open (modoal==false) jDialog

#657
From: Magnus
Date: Wed, 20 Apr 2005 17:29
22 lines
1722 bytes
Hello,

I have a menu entry that open a dialog.
The user can go back to original screen and open a new dialog from the 
same menu entry.
I would like to re-focus on the first one but can find a way to do this.

   public void jMenuItem1_actionPerformed(ActionEvent e) {

// Here I want to refocus if opened before ...

     Calculator dlg = new Calculator(this, "Just Test of Dialog", false);
     Dimension dlgSize = dlg.getPreferredSize();
     Dimension frmSize = getSize();
     Point loc = getLocation();
     dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x,
                        (frmSize.height - dlgSize.height) / 2 + loc.y);
     dlg.pack();
     dlg.show();
   }

Thanks in advance
Technical Details
Message-ID: <42669161@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,96415b146a3c2aed,start
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 20 Apr 2005 13:29:20 -0400
From: Magnus <magnus_bjorkman@iwon.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: en-us, en, sv
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: How to refocus an open (modoal==false) jDialog
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.67.187
Message-ID: <42669161@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1114018145 69.69.67.187 (20 Apr 2005 10:29:05 -0800)
Lines: 22
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail