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

The Archive Base Latest Questions

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

I would like to implement a wait preloading message in a Java desktop application

  • 0

I would like to implement a “wait” preloading message in a Java desktop application (I use Swing), like the preloaders the Ajax/Flash developers use in web applications.

My application uses a client/server architecture, and there may be some delay when moving from window to window, due to the response time of the server, but the user should not be able to do anything until all the content is loaded.

What’s the best practice to do this?
I had 2 ideas, but I think there should be a better way to handle this:

1 idea) Blocking the Event Dispatcher Thread (is that even possible?)

alternative idea) Hide the whole JFrame until the message exchange with the server is completed and the content is ready, showing another “wait” JFrame, but I dont really like this solution, because the main JFrame would keep flashing on/off during the user interaction

EDIT: Thanks to some hints I figured it out, but I can’t give the answer to anyone (nobody actually answered, i have only comments!), should i vote to delete the question?

  • 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:05:18+00:00Added an answer on June 11, 2026 at 1:05 am

    I solved the issue using a JDialog, playing with setVisible(true/false) and denying the possibility for the user to close the dialog by pressing the X button, using
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

    public class PreloaderDialog extends JDialog {              
    
            publicPreloaderDialog() {
    
                    initialize();
            }
    
            public final void initialize() {
    
                    JLabel waittext = new JLabel("Wait, please");    
                    add(waittext);
    
                    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
                    setModalityType(ModalityType.APPLICATION_MODAL);
    
                    setTitle("Loading in progress");
    
                    setLocationRelativeTo(null);
                    setSize(300, 120);
            }
    
            public void hide() {
    
               setVisible(false);                               
            }
    
            public void show() {                                       
    
                setVisible(true);                               
            }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to implement a simple AR desktop application. This application should first
In our ASP.NET 3.5 application, we would like to implement a "Please wait.." feature
I would like to use a setTimeout function so that Ajax calls are only
I would like to implement a distinct thread for each route in apache camel.I
I would like to implement a very simple way to store a variable containing
I would like to implement a function with R that removes repeated characters in
I would like to implement a simple queueing service specific to a project. Where
I would like to implement a switch button, android.widget.Switch (available from API v.14). <Switch
I would like to implement something similar to 37Signals's Yellow Fade effect. I am
We would like to implement a web form that automatically saves content at 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.