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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:14:10+00:00 2026-05-31T06:14:10+00:00

I have an application, on the beginning the Jframe is displayed, user enters the

  • 0

I have an application, on the beginning the Jframe is displayed, user enters the URL of a webpage that has to be analysed, then user clicks OK.

When user clicks OK actionListener should do this:
It should display a new Jframe with a text “please wait , analysing website, this may take a little”
then it should start the analyzePage() method.

the problem is that after user clicks OK button, the new Jframe is displayed, but it is blank, only with white rectangle inside. Only after analyzePage() method is finished (which is after many seconds) Contents of Jframe are displayed.

    static class OKListener implements ActionListener {

    public void actionPerformed(ActionEvent e) {
        new WaitFrame();
// mf is main frame (the first frame where url was entered and where OK was clicked)
        mf.setEnabled(false);
        address = mf.getURLtext();
        analyzePage();
    }
}

public class WaitFrame extends JFrame {

public WaitFrame() {
    super();
    JFrame wait = this;
    JLabel jl = new JLabel("Čakajte prosím, analyzujem stránku, môže to chvíľu trvať.");
    JPanel jp = new JPanel();
    jp.add(jl);
    wait.getContentPane().add(jp);
    wait.pack();
    wait.setVisible(true);
}
}
  • 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-31T06:14:12+00:00Added an answer on May 31, 2026 at 6:14 am

    Run your JFrame within the AWT-Thread:

    //...
    java.awt.EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            JFrame waitFrame = new JFrame();
            //...
            waitFrame.pack();
            waitFrame.setVisible(true);
        }
    });
    //...
    // Other things to do ...
    // dispose Frame after all, if neccessry ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a reference application that downloads an sql lite file in the beginning
i have a web application that is build as single page. Through one user
In my current application I have a form that requires the user to enter
I am just beginning to get into desktop application development, and have chosen C#
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in
I have Application X with Subform x1, x2, x3. The Subform has, because its
I have an application (C++) that I think would be well served by an
I have an application that rips aac+ audio streams, cutting them at every regular

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.