Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

floating JToolBar doesn't close  RSS feed

 
dmitry dvoinov
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all!

I have application with many frames in one workspace. One of them has a three JToolBar items. If i make JToolBar floating and then close frame - this floating toolbar isn't closed.

Does anyone know why, and how can i close it?
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you set a defaultCloseOperation on your parent frame?
 
dmitry dvoinov
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes!
DISPOSE_ON_CLOSE
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dispose will only get rid of the object you have closed; it doesn't shut down the JVM and obviously doesn't get rid of a floating toolbar.

Is it safe to use EXIT_ON_CLOSE? Or do you need to go through a file-saving method before closing?
Try that.

BTW: Dispose is the default, so you don't need to specify it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!