• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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) :

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!