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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:27:26+00:00 2026-05-24T01:27:26+00:00

How do I identify whether a JDialog component is already opened or not, thus,

  • 0

How do I identify whether a JDialog component is already opened or not, thus, it would avoid the same JDialog to be opened twice at the same application instance?

One solution I had in mind was to verify whether an object is already a JDialog instance (dialogObj instanceof JDialog), if so, I just call the method responsible for its construction / exhibition, if not, I just create a new JDialog instance (fill free to correct me if I’m delusional).

Let’s suppose I’ve created a JDialog containing one (1) JPanel, one (1) JTextField, one (1) JButton and the element that holds the event who will “display” the JDialog every time is a JMenuItem -> JPopUpMenu -> TrayIcon (System Tray icon).

I’ve almost discovered a way to solve it (as shown at the second paragraph), however, when I open it again through the System Tray, everything what I’ve typed before I’ve “disposed” the dialog box appears again, not to mention the others elements status that remains the same (JButton enabled etc – its another story).

Does anyone here have a clue how to solve it (of course it does)?

  • 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-24T01:27:26+00:00Added an answer on May 24, 2026 at 1:27 am

    To solve both tasks as

    • A) Init just ONE JDialog
    • B) To check is it opened

    You can simply use a modal JDialog as

    JDialog aDialog=new JDialog();
    aDialog.setModal(true);
    

    …this won’t let user to init another JDialog example 🙂

    Good luck

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

Sidebar

Related Questions

I need to identify whether or not large fonts are in use on Windows
I wanna know that how we can identify whether a page is redirecting to
I'd like to be able to identify whether a given DOM node has been
What's the best heuristic I can use to identify whether a chunk of X
How does sharepoint identify a file type? For example, SharePoint will not allow you
I am trying to identify whether a selected text (in Firefox) is bold or
Are there strategies or methods to identify whether a particular piece of code or
In PHP, I'm using an if statement to identify whether a user is logged
Is there a way to identify whether the browser encoding is set to/supports UTF-8
is there a way to identify whether the object is created with SET QUOTED_IDENTIFIER

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.