Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8068213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:35:33+00:00 2026-06-05T12:35:33+00:00

As a general rule, should a program with multiple sections create everything at startup

  • 0

As a general rule, should a program with multiple sections create everything at startup or should it wait to create each part when it is actually needed?

My specific case is a Java kiosk-style application that has multiple different sections. Each section is a different JPanel (with different buttons / JTables / JLabels / etc.) that does a specific task. This is an unfinished project that I haven’t touched in a while, but I’m going to complete it and I’m looking at the code and trying to refactor what I think I should have done otherwise.

So far, the program is creating every single JPanel at startup, so whenever an user clicks on one of the button that changes which JPanel is shown, it it loaded instantly since it’s already created. So far, I don’t think it would matter that much performance-wise, but I’d like to know what is standard practice in this case.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:35:35+00:00Added an answer on June 5, 2026 at 12:35 pm

    I would not load all on start up, as it might make start up slow and also some panels are loaded which are not required. For example you have 4 panels loaded contact, about, pics, and feeds. Suppose you load all 4 at start up, what if user just visited only 2 of them and then close the application. Sometimes it is possible that user wants see only one panel but he has to wait for all panels to load at start up. So I will suggest to load panels as they are required. Load only primary data on frame, and then when user clicks on a button for first time which loads a panel, show a progress bar until that panel is loaded, and from the next time he clicks on button just display the panel with out waiting as it is loaded already by first click.

    If your application is getting data from internet then loading all data on start up will also cost extra band width and data charges.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a general rule for when you should and shouldn't have a generic
I'm well aware that the general rule of thumb is you should only import
Is there a general rule as to when I should use void[] instead of
In Ruby on Rails Development (or MVC in general), what quick rule should I
According to the MySQL documentation: As a general rule, you should never assign a
There is a general rule of OO design that you should model is-a relationships
Is there a general rule, when one should use document.write to change the website
I wonder the general rule to use regular expression in if clause in bash?
As a general rule, are Java compilers localised? Are the compilers capable of emitting
I was told by an experienced programmer(spoj,codechef,topcoder etc ) than as a general rule

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.