Article View: borland.public.jbuilder.java.swing
Article #1200Re: Multi-screen apps - changing from screen to screen
From: Bradley Kieser
Date: Sat, 07 Feb 2004 23:53
Date: Sat, 07 Feb 2004 23:53
72 lines
4057 bytes
4057 bytes
John, thank yo for these extremely handy comments. I would just like to share my experience since posting this with others: I went for option (a) in the app in the end. Only thing is as the screens are very rich in graphics and other presentational layout components, after 12 screens we very quickly ran out of memory on app startup. So we needed to go to (d). Johm, how would you recommend implementing a "lazy load of panels" as you put it? I take it that you mean some sort of async load, but can you clarify or expand on this? Thanks, Brad John McGrath [TeamB] wrote: > 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. > >
Technical Details
Message-ID:
<40257c96@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-05!sn-xit-08!supernews.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<401ef4d5@newsgroups.borland.com> <4022b192$1@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-07 16:08:47 PST Date: Sat, 07 Feb 2004 23:53:06 +0000 From: Bradley Kieser <brad@kieser.net> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630 X-Accept-Language: en, en-us MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Multi-screen apps - changing from screen to screen References: <401ef4d5@newsgroups.borland.com> <4022b192$1@newsgroups.borland.com> In-Reply-To: <4022b192$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 158.152.220.148 Message-ID: <40257c96@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1076198550 158.152.220.148 (7 Feb 2004 16:02:30 -0800) Lines: 73 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-05!sn-xit-08!supernews.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail