Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tracking when a JComponent is visible  RSS feed

 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ComponentListener doesn't provide notification when, say, a frame is minimized or closed, just when setVisible() is called I presume (I haven't testing hiding a component behind something).

That actual problem, for the record, is that I have an animated component and I want it to be able to stop the animation thread if, say, the frame it's being displayed in is disposed(). Is there a way to track this?
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved. AncestorListener seems to get notification when a frame is disposed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!