🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Multi-screen apps - changing from screen to screen

#1195
From: John McGrath [TeamB]
Date: Thu, 05 Feb 2004 21:11
55 lines
3310 bytes
On 2/2/2004 at 7:59:49 PM, Bradley Kieser wrote:

> Card layout (a): For large apps that have many screens, using
> cardlayout to change from screen to screen causes memory overflows
> and the app chews large amounts of memory and is slow to load.

This solution does take more memory, but it is generally faster than
the most reasonable alternative.  There is no reason that it has to be
slow to load if you lazily load the different panels.

> Layers (b): This requires null or XY layout and is decidedly
> non-resizable! It has all sorts of problems not least of which is
> that you quickly confuse JBuilder and lose nearly all the visual
> design and layout ability.

There is nothing that would make this non-resizeable, nor should it
confuse JBuilder.  However, this is really pretty much the same as (a),
except that you have to write the code to show and hide the individual
panels.  That is what the CardLayout does, so why not use it?

> Creating new frames (c): This is a terrible solution because you are
> essentially restarting the app every time and reloading loads of
> things (such as menus) that shouldn't have to be reloaded.

Yes, this is a bad solution, but it is really not the same as
restarting the application.  But it would involve destroying and then
immediately re-creating several components such as the frame and the
menu, which is not good.  This could also cause the window to flash,
annoying the user.

> Creating/dropping objects (d): This seems the best of the bad choices
> but means that you quickly lose JBuilder's visual designing because
> it cannot understand the code. Also requires a lot of coding for what
> is really a fairly straight forward and dare I say probably well
> established and solved problem.

This saves on memory, but it takes longer to re-create the panels each
time you need to show them.


I think you are better off with either solution (a) or (d).  This is
the classic speed / size trade-off, so which you choose will depend on
the application and the target audience.  I have generally opted for
faster (a) over smaller (d), since memory is very cheap these days, but
your situation may be different than mine.


-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <4022b192$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newspeer1.nwr.nac.net!nntp.cifnet.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <401ef4d5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,cd46b352a2e83d5c
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-02-05 13:33:38 PST
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: Multi-screen apps - changing from screen to screen
Newsgroups: borland.public.jbuilder.java.swing
References: <401ef4d5@newsgroups.borland.com>
User-Agent: XanaNews/1.15.8.5
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
NNTP-Posting-Host: 141.158.35.81
Message-ID: <4022b192$1@newsgroups.borland.com>
Date: 5 Feb 2004 13:11:46 -0800
X-Trace: newsgroups.borland.com 1076015506 141.158.35.81 (5 Feb 2004 13:11:46 -0800)
Lines: 55
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newspeer1.nwr.nac.net!nntp.cifnet.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail