A
A
Alexander Rybakov2016-02-02 21:47:38
Java
Alexander Rybakov, 2016-02-02 21:47:38

What command closes the program?

what to write in the condition to the JButton, which should close the program I
'm just learning to program

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
KeFA, 2016-02-03
@turkish777

2 ways for java:
1) System.exit(status) - closes the application normally, calling shutdown hooks before that.
2) Runtime.getRuntime().halt(status) - closes the program in an extreme way without calling hooks.
The first way is preferable. If it’s not clear what shutdown hooks are, then Google will help.

I
IceJOKER, 2016-02-02
@IceJOKER

Then learn how to use Google first!
stackoverflow.com/questions/2670956/how-to-quit-a-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question