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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:58:40+00:00 2026-05-16T22:58:40+00:00

I am currently porting my Android app to a desktop app using Java (Swing,

  • 0

I am currently porting my Android app to a desktop app using Java (Swing, NetBeans).
I need a main java window and several pop-up forms for user IO. In the android app I have been using activities, eg: startActivity(anotherActivity). I am currently using a JFrame for each pop-up form in the PC app I have been using setVisible to simulate opening the forms from menu actions and other event logic, but hitting the close button on any of the pop-up forms closes the entire app, not just the form. Should I be using something other than setVisible(true|false)? Should I be using something other than JFrames such as a JPanel or JDialog? Should I override close() on my child forms to do setVisible(false)? Unfortunately, I am learning Java, Swing, and NetBeans on the fly so the best approach to these types of problems is not obvious (to me).

Edit: Why is the auto generated code in initComponents() set to EXIT_ON_CLOSE when the defaultCloseOperation is set to HIDE in the swing form properties?

  • 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-16T22:58:41+00:00Added an answer on May 16, 2026 at 10:58 pm

    You probably want to adjust the default close operation, to just hide the frame instead of quitting the app:

      setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
    

    Resources

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

Sidebar

Related Questions

im currently porting my iphone app to android. this app makes heavy use of
Currently I'm developing an Android app for that I'm using the Facebook SDK. It's
I am currently porting an application from iOS into Android and I have ran
I'm currently porting my jruby/java2d Graph Drawing/Layouting application to macruby/cocoa. Therefore I need to
I'm currently porting my GAE app to Python 2.7 and have come across some
What do I need to know to port Cyanogenmod to currently unsupported android phones
I'm currently porting an app that was written for Windows Mobile 2003 (compact framework
I'm porting a game from WP7 XNA to Android; everything was working using Canvas
I'm currently porting an application from Fortran to C and need to output some
I'm currently porting a very nice demo of a modular web interface using OSGi

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.