Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with java.lang.IllegalStateException: Cannot set modality once stage has been set visible

 
Ertan Hasani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys , im having an issue : when i click a menuItem it shows a window who says that "are you sure you want to logout" , and i click no (so that window is closed), but when i click again i that menuItem it shows me java.lang.IllegalStateException: Cannot set modality once stage has been set visible.

What should I do ?

Here's the code:

MainWindowController.java



Here's the method to close that window if user click "NO" i dont want to logout


OUTPUT:


MainWindowController.java.43 line is this one:
 
Ertan Hasani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All i needed to do was to split setup(initialize) and control (logoutWindow) :

 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!