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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:37:44+00:00 2026-06-01T18:37:44+00:00

My application offers the ability to launch a long-running task. When this occurs a

  • 0

My application offers the ability to launch a long-running task. When this occurs a modeless JDialog is spawned showing the progress of the task. I specifically make the dialog modeless to allow the user to interact with the rest of the GUI whilst the task runs.

The problem I’m facing is that if the dialog becomes hidden behind other windows on the desktop it becomes difficult to locate: There is no corresponding item on the task bar (on Windows 7), nor is there an icon visible under the Alt+Tab menu.

Is there an idiomatic way to solve this problem? I had considered adding a WindowListener to the application’s JFrame and use this to bring the JDialog to the foreground. However, this is likely to become frustrating (as presumably it will mean the JFrame then loses focus).

  • 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-01T18:37:45+00:00Added an answer on June 1, 2026 at 6:37 pm

    You can create a non-modal dialog and give it a parent frame/dialog. When you bring up the parent frame/dialog, it also brings the non-modal dialog.

    Something like this illustrates this:

    public static void main(String[] args) throws IOException {
        JFrame frame = new JFrame();
        frame.setTitle("frame");
        JDialog dialog = new JDialog(frame, false);
        dialog.setTitle("dialog");
        final JButton button = new JButton("Click me");
        button.addActionListener(new ActionListener() {
    
            @Override
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(button, "Hello");
            }
        });
        final JButton button2 = new JButton("Click me too");
        button2.addActionListener(new ActionListener() {
    
            @Override
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(button2, "Hello dialog");
            }
        });
        frame.add(button);
        dialog.add(button2);
        frame.pack();
        dialog.pack();
        frame.setVisible(true);
        dialog.setVisible(true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi, We have a WinForm application running och Windows. This application offers extended logging
I have PHP application for offers. In this application when user log in I
An application I maintain offers a standard password reset script. My employer wants to
Is there any API SQL Server 2008 offers for .net application to create and
We have an SaveFileDialog in our application, which offers a variety of formats the
Application has an auxiliary thread. This thread is not meant to run all the
I've an application that offers its Business Layer through a Service Layer developed with
I want to distribute a small application that offers a web interface intended for
The Google Market offers an application purporting to run J2ME MIDP applications on the
When I create a ASP.NET MVC web application in Visual Studio 2010 it offers

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.