Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / September 2004

Tip: Looking for answers? Try searching our database.

Many Frames

Thread view: 
Shane Mingins - 02 Sep 2004 22:59 GMT
Hi

We're going to be developing a large app which will contain over 100 screens
for the user.  Initially we thought that this would mean many JFrames (i.e.
each screen is a JFrame).

Talking to a Sun consultant this was advised as a bad idea as JFrames are
resource intensive and a better solution would be to have one JFrame and the
many screens implemented as JPanel's and swapped in and out of the main
JFrame.

But then talking to another person who has just completed a large Swing app,
they used Internal Frames, saying that they are a lightweight object.

I just wondered what is the generally used approach for an app with many
screens?

Thanks
Shane

Signature

Today I want to do something better than when I did it yesterday

Jacob - 02 Sep 2004 23:44 GMT
> We're going to be developing a large app which will contain over 100 screens
> for the user.  Initially we thought that this would mean many JFrames (i.e.
> each screen is a JFrame).

Check your design! A program with more than 100 windows
will end up as a disaster for your customer. No matter
how they are technically implemented.

Put the vital information from you data model
into main window(s) (i.e. JFrames), and leave secondary
information in transient non-modal dialogs (JDialog).
If you end up with more than a few main windows there
is something wrong with your data model.

The advice from your "Sun consultant" is strange as it
means you cannot have multilpe windows open simultaneously.
Also I doubt his conclusion: Unless you have all 100 windows
open simultaneously (and if you need, see above), the garbage
collector will clean the mess as you go.

And as said before: That something is technically
feasable does not necesserily mean it is a good idea:
Please, please do not use internal frames!
Shane Mingins - 03 Sep 2004 02:16 GMT
> > We're going to be developing a large app which will contain over 100 screens
> > for the user.  Initially we thought that this would mean many JFrames (i.e.
[quoted text clipped - 3 lines]
> will end up as a disaster for your customer. No matter
> how they are technically implemented.

I assume you are meaning displaying 100 windows at once???  Which would be
indeed a disaster ;-)

I was meaning that we have over 100 screens .... only one displayed at a
time ... and that we thought that this would mean coding 100 JFrames ....
and now it looks like it will mean coding 100 JPanels.

There are a certain subset of these 100 that will be used often and so we
may instantiate these upon application startup and leave the rest to
lazy-load.

> The advice from your "Sun consultant" is strange as it
> means you cannot have multilpe windows open simultaneously.
> Also I doubt his conclusion: Unless you have all 100 windows
> open simultaneously (and if you need, see above), the garbage
> collector will clean the mess as you go.

He was saying that because a JFrame has to be rendered (not sure if that is
quite the right word) as a native component of the o/s it uses more resource
than a lightweight component like a JPanel.

Cheers
Shane


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.