0

https://i.stack.imgur.com/YhSE3.png

after i set "toolbar.setVisible(false)" to false , jtoolbar is hidden, but jframe is still on screen ? how can i dispose that temporary frame ?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • for better help sooner post and [SSCCE](http://sscce.org/), short, runnable, compilable, just about JFrame with JToolBar – mKorbel Apr 05 '13 at 12:32
  • http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=d5e5ef54386707302d50687fe39b?bug_id=4418849 – Waqas Memon Apr 05 '13 at 12:35

1 Answers1

0

I close JFrames with JFrameName.setVisible(false) it will hid it but if you want to use the same window again you will have to reset the window when you make it visable again.

wolfcall
  • 678
  • 1
  • 8
  • 18
  • but how to close JToolBar's frame, when you drag it from main frame ? – Aleksandar Djurdjevic Apr 05 '13 at 13:28
  • Oh in that case you might want to use a listener, one that triggers on the drop so you don't lose the window then you start dragging, and check the number of child elements. You can check this with `JFramename.getComponents()` this will return a component array. Look and see if the components are still there if not execute `JFrameName.setVisible(false)`. – wolfcall Apr 05 '13 at 13:38