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

The Archive Base Latest Questions

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

Hey all i have two JFrames one is my main login frame, user enters

  • 0

Hey all i have two JFrames one is my main login frame, user enters a username and password etc…

Once logged in the user is moved to the main desktop program.

Example:
When a user loads the first time and decides to exit they click the x in the corner this calls my addWindowListener event and they click (cancel) it does nothing. This is what i want.

However if a user logges in an goes from my login form to my main desktop window and then clicks x, it calles the addWindowListener event in the main window and asks if they wish to logout. Problem is when ever they click on an action it asks it again. I have checked into this and it seems to be happening each time a new window is called.

So… may question is how can i make my event only be called once?

Further examples

Start Program > Click X > Click Cancel (this works fine)
Start Program > Login > Click X in Main window > Click Cancel (asks again)

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

    1) don’t use two JFrames, use JDialog with parent / owner for JFrame

    2) on some of event (after correct logon) you can remove WindowListener from JFrame (better would be JDialog)

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

Sidebar

Related Questions

Hey all, Here's a funny one. I have two ViewControllers: first one (fires on
Hey all - I have an app where I'm authenticating the user. They pass
Hey all, I have something of an interesting requirement for my project. I need
Hey all. I have a server written in java using the ServerSocket and Socket
Hey all. I have a question on how to implement the following with Django.
Hey all, I have been doing nothing but web development over the last few
Hey all, basically i have an empty AS3 fla file with just the following
Hey all, i have been trying for a few minutes on this problem and
Hey all, i have a problem with trying to get 2 forms to close
Hey all, this is the code i have to check for a day thats

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.