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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:09:44+00:00 2026-05-29T12:09:44+00:00

I am currently having a minor issue with a Java Jframe and a button

  • 0

I am currently having a minor issue with a Java Jframe and a button not updating.

I am trying to disable the Print Button until the printing of the new JFrame it opens is done and that JFrame is closed…

The button will only disable if and when a new window occurs, but will not until then, which can take a little bit of time….

I set the button to disable by doing this: PrintBttn.setEnabled(false);

I have tried calling mainPanel.revalidate(); mainPanel.repaint(); PrintBttn.revalidate(); PrintBttn.repaint as well as a mixture of the above as they recommended in other forums…

I am kind of lost at the moment on this and to why it is not disabling the button until a new window appears since the first thing i do is Disable it as shown above, and then go through and create the new window….

Thanks,
Erik

  • 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-29T12:09:44+00:00Added an answer on May 29, 2026 at 12:09 pm

    Most likely, it’s a question of releasing the EDT to allow it to repaint the disabled button.

    Generally, it will look something like this:

    PrintBttn.setEnabled(false);
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            // Code to display the second JFrame goes here
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently having a major issue with a python script. The script runs arbitrary
Hi All I am currently having an issue calling a WCF service from a
Hello I'm currently having an issue with a timer in a program I'm developing.
The issue I'm currently having is mapping multiple GUI fields to object properties (i.e.
Currently having this really odd problem with my layout IE7. I'm not very experienced
I am currently having an issue running a Jessica application via VS2010 and Cassini.
I'm currently having an issue with stopping a background thread in a webachive. I
I'm currently having an issue with UIViewController 's presentModalViewController:animated: . I use the following
I am currently having an issue where MySQL is only displaying 1 of my
Currently having an issue with getting the CSS to display a mockup page correctly.

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.