Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setDefaultClose  RSS feed

 
Wayne Hefner
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java program that uses swing and JFrame. I use the setDefaultClose method of JFRAME to close the app. If I type the java call on the command line the class works fine. However if I type the same command in a file and launch it from the script the close events are not captured and I need to control C to kill the gui app.
If I instead use a window listener it works in both locations.
Has anyone seen this before or know what is causing this.
 
Wayne Hefner
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone???
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... I'm running Java 1.3.1 and I'm not having this problem... I just tested it out... you are using setDefaultCloseOperation( EXIT_ON_CLOSE ) right?

Maybe your PATH is not set correctly and you're running the MS JVM and not the Sun JVM. Explicitly call C:\{JavaDir}\bin\java.exe or add the directory to your PATH in the batch file.

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