How to stop a Application using the command "javaw" on Windows Platform?

Hello,everyoneHow to stop a Application using the command "javaw" on Windows Platform?Thank you in advance.zhongboqing
[153 byte] By [zhongboqing790612] at [2007-9-26 3:54:14]
# 1

> How to stop a Application using the command

> mand "javaw" on Windows Platform?

If you don't have methods to do just that, then you have only one choice. Task Manager, and kill the job.

You have to catch an event if you want to close your window by clicking on that X at the right top corner. Here's the code:

class MyFrame extends JFrame {

MyFrame() {

addWindowListener(

new WindowAdapter() {

public void windowClosing(WindowEvent e) {

System.exit(0);

}

}

);

// ... adding components, whatever

pack();

setVisible(true);

}

}

Hope I answered your real question.

Best Regards,

Ivan

ivanhu at 2007-6-29 12:43:12 > top of Java-index,Developer Tools,Java Compiler...
# 2
Ivan,Thank you very much first.I have another requirement. I want to run a back-end application that hasn't any GUI,Can I stop it?Thank you again.Best regards,zhongboqing
zhongboqing790612 at 2007-6-29 12:43:12 > top of Java-index,Developer Tools,Java Compiler...
# 3

You have to take care of it in your back-end program. For example, check periodically if a file exists or not. When the file appears, stop your program. If your program doesn't take care of it, then nothing will, and it will run forever. In this case, the only remaining option is using the Task Manager of the windows, or the "kill" command in unix-likes.

ivanhu at 2007-6-29 12:43:12 > top of Java-index,Developer Tools,Java Compiler...
# 4
I see. Thank you very much.
zhongboqing790612 at 2007-6-29 12:43:13 > top of Java-index,Developer Tools,Java Compiler...