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

  • Home
  • SEARCH
  • 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 6052905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:58:49+00:00 2026-05-23T07:58:49+00:00

I am creating a setup appplication. I have a main class which initialize an

  • 0

I am creating a setup appplication.
I have a main class which initialize an application; which has a JFrame and 2 JPanel variable namely panelX and panelY. This main class creates a JFrame and add panelX and panelY to it. In these panels panelY has three JButtons (namely Back, Next and Quit). panelY remains as it is during entire process. Where panelX changes its contents as on the click event of Next and Back Button.

I also have some other classes. These classes has a method which returns JPanel having different conponent added to them.

In my code when I click Next Button as well as Back Button following steps occure

1) I calls removeAll() method to remove all the componant of panelX

2) panelX is assinged to null.

3) Call is made to respective method of the above classes and which returns JPanel. This
returned JPanel is assigned to panelX.

Ex.

panelX.removeAll();    
panelX=null;    
panelX=getNextPanel();

4) After above step; I call repaint(); and validate method on panelX.

Ex.

panelX.repaint();
panelX.validate();

The problem is when I press Next Button Its shows proper panel but when I press Back Button after 2 time clicks on Next button and moves mouse pointer on panelX it shows componants of previous assigned panel as well.

So please tell me friends how I solve this problem.

Thank You!

  • 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-23T07:58:49+00:00Added an answer on May 23, 2026 at 7:58 am

    Use a CardLayout, as shown here.

    Game view High Scores view

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

Sidebar

Related Questions

We currently have one dynamic web project (our main web application) already setup on
I am playing around creating a demo prism application. The application I have has
While creating the setup for VB.net application I am getting the following warning: Warning
The basic setup is classic - you're creating a Windows Forms application that connects
I've got an ASP.NET application that I installed by creating a web setup. I
I have created a windows application setup program, it needs to have a text
I have an application written in C# which depends on sqlite managed provider. The
I am busy creating my very first Facebook application, and although I have PHP
I am using DWR for one of my application. I have setup the environment
I am creating an Installer for my application(which basically acts as an server). Now,

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.