Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NullPointerException when I close window  RSS feed

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get a NullPointerException when I close my swing window .It occurs here at the lable point

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Cairn_Image_Splitter$2.actionPerformed(Cairn_Image_Splitter.java:263)




is the action litener being called when i close the window?
 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm I added

plugInFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

and it works.
Not sure why though, the JFrame still closed without it, only with an exception thrown.

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