Article View: borland.public.jbuilder.java.swing
Article #409Re: How to refocus an open (modal==false) jDialog
From: Magnus
Date: Fri, 22 Apr 2005 15:44
Date: Fri, 22 Apr 2005 15:44
26 lines
1839 bytes
1839 bytes
I have changed the from "extend JDialog" to "extend JFrame" but still
have the same question ...
Magnus wrote:
> 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:
<42691bc7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42669161@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,96415b146a3c2aed X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 22 Apr 2005 11:44:29 -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: Re: How to refocus an open (modal==false) jDialog References: <42669161@newsgroups.borland.com> In-Reply-To: <42669161@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.67.187 Message-ID: <42691bc7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1114184647 69.69.67.187 (22 Apr 2005 08:44:07 -0700) Lines: 26 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail