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

set 2nd JFrame active & 1st JFrame cant modify  RSS feed

 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i create a JFrame, in it when i click on the menu item, JDialog pop up, when i click on the button on JDialog, such as : OK button. the 2nd JFrame pop up and JDialog setvisible(false)....

when we open JDialog, constructor of it takes JFrame parents, and boolean modal right? so that's why it is active, and we cannot click on 1st JFrame, unless the JDialog finish function right?

well, its fine with my JDialog...now i want the 2nd JFrame to be active and i want to finish 2nd JFrame , then only 1st JFrame can click...

how to set that? i tried so many times with the constructor, i check API, still dilemma with it...

i hope someone can help..thanks.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any reason why you need this
JDialog setvisible(false)....

instead of this
dispose(); (JDialog)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!