Article View: borland.public.jbuilder.java.swing
Article #1187Multi-screen apps - changing from screen to screen
From: Bradley Kieser
Date: Tue, 03 Feb 2004 00:59
Date: Tue, 03 Feb 2004 00:59
42 lines
3032 bytes
3032 bytes
This is a question about a proper application development. I.e a multi-screen, menu and button driven app that changes the contents of the window that the user sees based on actions and context. A normal app seems to me to have a frame and then areas that are refreshed with various jpanels depending on what the "screen" is. For example going from a login screen to a data display screen. There seems to be several ways to achieve this: a) Use cardlayout and change visibility to bring the required card "screen" to the foreground. b) Layer panels on top of each other and change their visibility. c) Invoke new frames and exit old ones. d) create and drop jpanel objects and position these on the screen. 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. 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. 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. 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. I keep thinking that I am missing a trick with JBuilder X but I have looked and looked in the manual and cannot find anything that solves this problem. This is at start as far as any app dev is concerned and given how mature JB is now, should have been solved in JB ages ago. So what am I missing? What is the best solution to this problem? Anyone have any tips or ideas for me?
Technical Details
Message-ID:
<401ef4d5@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,cd46b352a2e83d5c,start X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-02-02 17:12:45 PST Date: Tue, 03 Feb 2004 00:59:49 +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: Multi-screen apps - changing from screen to screen Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 158.152.220.148 Message-ID: <401ef4d5@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1075770581 158.152.220.148 (2 Feb 2004 17:09:41 -0800) Lines: 43 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail