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 7547593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:29:34+00:00 2026-05-30T09:29:34+00:00

Think about the classic installation process, where you have a next button and when

  • 0

Think about the classic installation process, where you have a “next” button and when you click it the content of the window changes. To represent this situation I thought of two possible solutions:

-when “next” is clicked destroy the current JFrame and create a new JFrame, maybe passing to his constructor useful information (e.g. actual window size, content inserted by the user in the current frame, …)

-when “next” is clicked remove all the components from the current JFrame and add new components as needed

The first solution looks way better about OOprogramming, because I can keep separate classes for different frames and I can avoid huge methods that empty the frame and repopulate it. However the first solution sounds a bit “dirty” and I should pass lots of parameters to the new frame. To represent this situation I would choose the second solution.

Now think about a menu with an “option” component: in this situation I would create a new JFrame when “option” is clicked, so that I can populate it with option items. Is this a correct solution? Is there a way I can always know which one is the best solution? Are there any solutions I didn’t think about?

  • 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-05-30T09:29:36+00:00Added an answer on May 30, 2026 at 9:29 am

    Destroying the main JFrame would be silly — not to mention jarring for the user. Just use a single JFrame and change its contents.

    To implement an installer wizard, use a single JFrame containing one large JPanel on top and a smaller one containing the “Next”, “Back”, “Cancel” buttons along the bottom. When the Next or Back buttons are pressed, you replace the large JPanel. You can have many different JPanel subclasses, one for each “page” of the wizard.

    There’s a LayoutManager called CardLayout which is ideal for implementing this scenario — it manages a “stack” of components, and only shows one of those components at a time. Use a BorderLayout in the JFrame. Into the center position put a JPanel with a CardLayout. Then add the individual pages of the wizard to that JPanel, so the CardLayout can manage them.

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

Sidebar

Related Questions

What do you think about this build tool ? I'm thinking of migrating from
What do you guys think about this for a generic singleton? using System; using
How do you think about data access code like this: public void AddCusotmer(Cusotmer customer)
I'd like to know what you think about this part of our program is
I have a classic Order -> Order Row scenario something like this: public class
Clarification: this is not about user agent calls to pages, but Classic ASP calling
Here's the situation: I have a bit of graphical content inside a symbol that
I think I'm misunderstanding something about how this works. This is my fluent mapping:
We have a classic VBScript default.asp page in the root of our site. (This
Think about the following: Your ISP offers you a dynamic ip-address (for example 123.123.123.123).

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.