Article View: borland.public.jbuilder.java.swing
Article #1164Re: How to prevent MDI windows from being moved by user
From: John McGrath [TeamB]
Date: Fri, 19 Mar 2004 22:24
Date: Fri, 19 Mar 2004 22:24
55 lines
3360 bytes
3360 bytes
On 3/19/2004 at 9:38:30 AM, John T. Dow wrote:
> 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.
Now I think I am confused. I thought you were saying that your code
was going to determine the positions of the panels at runtime. If that
is the case, then I think using XYLayout (or no layout) might make
sense. But it is a *bad* idea to use XYLayout and to determine the
coordinates at design time.
Are you talking about something different here? Before you were
talking about placing the panels and now you are talking about placing
the child components inside the panels? Again, in that case,
determining the exact coordinates at design time is a *bad* idea.
> 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.
XYLayout does allow the child components to overlap each other, but you
are correct that it does not provide any mechanism for controlling the
Z-order. The Z-order is controlled by the container itself, not by the
layout manager.
> 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.
Right. Those are features of JBuilder's UI Designer, not of Java or
any of the standard Java libraries. They modify the code that the
Designer writes such that the components are added to their parent in a
different order. You can do the same thing runtime using the Component
add() method.
> 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);
That is exactly the same as it would be without any layout manager at
all. This would work with a plain JPanel inside another JPanel.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<405b731f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.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> <405B05E6.3050302@johntdow.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 14:39:56 PST From: "John McGrath [TeamB]" <ng-b@JPMcGrath.net> Subject: Re: How to prevent MDI windows from being moved by user Newsgroups: borland.public.jbuilder.java.swing References: <405A1103.5040103@johntdow.com> <405a7912@newsgroups.borland.com> <405A7EAB.3080204@johntdow.com> <405a9003$1@newsgroups.borland.com> <405B05E6.3050302@johntdow.com> User-Agent: XanaNews/1.16.1.11 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 151.197.214.141 Message-ID: <405b731f$1@newsgroups.borland.com> Date: 19 Mar 2004 14:24:31 -0800 X-Trace: newsgroups.borland.com 1079735071 151.197.214.141 (19 Mar 2004 14:24:31 -0800) Lines: 56 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail