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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:48:39+00:00 2026-06-11T01:48:39+00:00

if(Back.equals(e.getActionCommand())) { escape.setVisible(false); paused = false; running = !running; Graphics g = start.getGraphics(); g.dispose();

  • 0
if("Back".equals(e.getActionCommand()))
{
    escape.setVisible(false);
    paused = false;
    running = !running;
    Graphics g = start.getGraphics();
    g.dispose();
    Component glassPane = start.getGlassPane();
    glassPane.setVisible(!glassPane.isVisible());
    Main.main(null);
    Main.running = true;
    start.dispose();
}

This is my code for disabling my jframe, loading a new one, and disposing it. Whenever I do this, when I return to the frame I get strange graphical errors.
One of the graphical errors!

How do I close the frame completly?

  • 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-11T01:48:41+00:00Added an answer on June 11, 2026 at 1:48 am
    • create private/public(depends of your code design) variable for JFrame instance

    • then you can’t bothering with dispose of visible JFrame and then re_create a new one

    • create class or local instace that returns JPanel with game content

    • call JFrame#getContentPane#removeAll()

    • call JFrame#getContentPane#add(new GamePanel())

    • maybe there are easiest ways how to reset whatever (depends of your code design) to the start_up statuses

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

Sidebar

Related Questions

Back in MVC3, I had a custom ControllerFactory which would use my own container
Back in college I wrote a game where the computer would sleep for 1
Back in the days before Visual Studio Web Server we would host our local
Back in October, Kristopher Johnson asked about Accounting Software Design Patterns He received several
Back in my C/C++ days, coding an infinite loop as while (true) felt more
Back in my days as a BeOS programmer, I read this article by Benoit
Back when I was learning HTML, I loved how easy it to build pages
back in school, we wrote a compiler where curly braces had the default behavior
Back in the past, i found a third party webpage that was able to
Back again with a javascript question within sharepoint. I would like to hide a

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.