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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:42:52+00:00 2026-05-31T23:42:52+00:00

I have a JButton MAIN_BUTTON in a window. When it is clicked it starts

  • 0

I have a JButton “MAIN_BUTTON” in a window. When it is clicked it starts a new thread every time.

The newly created thread in turn calls a method of another class that displays a new “child_window”*(using a constructor and creating an object of it)*. This window has two buttons on it “accept” and “reject”. When any of these buttons are pressed then some work is done and this window is closed.

Now I want to know after stopping the thread whether the “CHILD_WINDOW” object is destroyed or it still exists in memory.

  • 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-31T23:42:53+00:00Added an answer on May 31, 2026 at 11:42 pm

    Now I want to know after stopping the thread whether the “CHILD_WINDOW” object is destroyed or it still exists in memory.

    In the general case, the answer depends on your what the thread has done with the reference to the object. If it has put it somewhere that means that it is “reachable”, then the object will still exist. If not, it may cease to exist, depending on whether and when the GC gets around to collecting it.

    I’m not entirely sure what happens in the case of a Window object. I suspect that there may be some reference to the object in the graphics context (or something) that means that the Window will remain reachable until some application-level code explicitly closes or disposes it. (Otherwise, you’d hear stories of Swing windows disappearing randomly … due to being reclaimed by the garbage collector.)

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

Sidebar

Related Questions

I have a jTable and a jButton. When clicked, the button's actionPerformed method calls
I have created in my Java Swing application a main window with a JButton.
I have this code: public class Window extends JFrame { public Window(){ ... JButton
I have a JList, and a JButton, user can click an item in the
I have a dynamic application that need to create a window interface with checkbox.
Possible Duplicate: non static method cannot be referenced from static context hey i have
I have created a swing application as bellow which shows main tasks in tabs
I have a program with a GUI that needs to open a separate window
Hi I have created a Jtable and can get it to show on my
I have created three Panels csvSrvrPanel, syncPanel and monitoringSrvrPanel. In monitoringSrvrPanel I have a

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.