Article View: borland.public.jbuilder.java.swing
Article #1154Re: How to prevent MDI windows from being moved by user
From: John T. Dow
Date: Fri, 19 Mar 2004 14:38
Date: Fri, 19 Mar 2004 14:38
67 lines
3602 bytes
3602 bytes
John
I haven't designed the various panels yet, but I plan to use the
XYLayout for them because I need to fill them with lots of data fields
and buttons etc.
I understand that the XYLayout would let me position panels as desired.
But as far as I know, it doesn't let one panel overlap another, and
there is no way to move a panel that's behind (or partially behind)
another to the front. There is a move to front and move to back (or is
it top and bottom?) but that's to be used during design, not during
execution.
At this point I have internal frames working very nicely. For example,
for a panel named "Address", I have the following bits of code.
To set the position and size of one of the frames:
IFAddress.setBounds(26, 23, 750, 635);
To open and make active an internal frame:
IFAddress.show();
try { IFAddress.setSelected(true); }
catch(java.beans.PropertyVetoException ex) { }
To close it:
IFAddress.dispose();
To make it active (e.g. from a drop down "Windows" menu, or under
program control):
try { IFAgent.setSelected(true); }
catch(java.beans.PropertyVetoException ex) { }
Except for not being able to prevent the frames from being moved, this
is doing everything I need. I can probably live without that if there's
no simple solution. Plan B is to make it easy for the user to put
everything back into its standard location. Perhaps the Windows menu
could have "Reposition" at the top. From reading the documentation,
reshape() looks like it would do this job.
John
John McGrath [TeamB] wrote:
> On 3/19/2004 at 12:01:31 AM, John T. Dow wrote:
>
>
>>I am not aware of any of the layout managers that provide multiple
>>panels simultaneously visible in a cascaded-type arrangement. (Maybe
>>staggered is a better word, as "cascade" probably has a specific
>>meaning?) The card layout only shows one at a time. The overlay
>>layout is intended to show you all at once, using transparency.
>
>
> Try the Borland XYLayout. This does not really do very much - it just
> sets the bounds of its child components to the values set by the
> caller. Normally the layout manager determines the bounds, so XYLayout
> is really kind of a "slacker" of a layout manager.
>
> What might makes more sense for your application is to write your own
> layout manager. Since you already have the code that determines where
> the panels should go, this should be trivial.
>
Technical Details
Message-ID:
<405B05E6.3050302@johntdow.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<405A1103.5040103@johntdow.com> <405a7912@newsgroups.borland.com> <405A7EAB.3080204@johntdow.com> <405a9003$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,7c722403acaaadbc X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-03-19 06:40:15 PST Message-ID: <405B05E6.3050302@johntdow.com> Date: Fri, 19 Mar 2004 09:38:30 -0500 From: "John T. Dow" <john@johntdow.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: How to prevent MDI windows from being moved by user References: <405A1103.5040103@johntdow.com> <405a7912@newsgroups.borland.com> <405A7EAB.3080204@johntdow.com> <405a9003$1@newsgroups.borland.com> In-Reply-To: <405a9003$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 4.15.244.33 X-Trace: newsgroups.borland.com 1079707116 4.15.244.33 (19 Mar 2004 06:38:36 -0800) Lines: 68 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail