Skip Navigation Links



How to close Java program or Swing Application with Example

Author : Javin Paul      Blog :TIBCO RV FIX PROTOCOL JAVA TUTORIAL      Date: 6/18/2012 2:10:00 PM


In order to close Java program we need to consider which kind of Java application it is?, because termination of Java application varies between normal core java program to swing GUI application. In general all Java program terminates automatically once all user threads created by program finishes its execution, including main thread. JVM doesn't wait for daemon thread so as soon as last user thread finished, Java program will terminate. If you want to close or terminate your java application before this your only option is to use System.exit(int status) or Runtime.getRuntime().exit(). This cause JVM to abandon all threads and exit immediately. Shutdown hooks are get called to allow some last minute clearing before JVM actually terminates. System.exit() also accept an int status parameter where a non zero value denote abnormal execute and its the result returned by java command to caller. In this java tutorial we will see example of closing both Java program and Java Swing application. This is also a good swing interview questions which you can ask to any GUI developer and my second article in swing after writing invokeAndWait vs invokeLater
Read more »

Bloggers

active bloggers in the last 24 hrs. Number shown in the bracket represents number of posts published in past 24 hrs,


other authors(81)

sankarshan(10)

Vashi Chandiramani(5)

AMJAD KHAN(4)

Firoze Shakir Photographerno1(4)

Abhay Naxalrevolution(3)

Shruthi(3)

abrachan(2)

Ankit Gupta(2)

DIGITALASIAN(2)

KUNJUBI VARGHESE(2)

mad madrasi(2)

pratish(2)

ravi dabas(2)

RWABhagidari.blogspot.com(2)

Sam Hindus Blog.(2)

Vikram Karve(2)

A S(1)

Aarthi(1)

AbhiLaSH RuHeLa(1)

Abhishek K. Mishra(1)

Ajithkumar Krishnakumar(1)

AK(1)

aKuma(1)

Alice(1)

Ambica Srimal(1)

Amrutha Technologies(1)

Anil(1)

Anu Varma(1)

Aslam B(1)

Champa(1)

Cloud Nine(1)

Cynical(1)

Devi(1)

Dew(1)

DMenon(1)

Elizabeth(1)

Fire Crystals(1)

Hari Chandana P(1)

Harini Padmanabhan(1)

Hawk Eye(1)

Heena Jain(1)

Indian Thematic Society(1)

Itchingtowrite(1)

Iti(1)

Izaj Ahmed Shaikh(1)

Javin Paul(1)

John Mathew(1)

jquerybyexample(1)

Kannada Cuisine(1)

Karvy Private Wealth(1)

Kollemcodeonline(1)

Krithi Karthi(1)

krzna(1)

Lucius Lobo(1)

Madhavi Madhurakavi(1)

Mahesh Kalaal(1)

Mandira(1)

Manreet Sodhi Someshwar(1)

Meera Sundararajan(1)

Minu CP(1)

Miss Frangipani(1)

Mohammad Khalid Siddiqui(1)

Monu Awalla(1)

Nadhiya Mali(1)

nimisha mistry(1)

Nisa Homey(1)

Nisha(1)

P.(1)

palak sharma(1)

parashar pandya(1)

parth joshi(1)

parvathy gopalakrishnan(1)

Patricia Torres(1)

Pooja Lokhande(1)

Prashanth(1)

Preety(1)

Priya Srinivasan(1)

R.D. Bhalekar(1)

Rajlakshmi(1)

Reema(1)

Renu(1)

Roli Bhushan-Malhotra(1)

Rup(1)

sangeeta(1)

Sangeetha M(1)

Sangitha(1)

Saurabh Moondhra(1)

Saurabh Moondhra(1)

share consultants(1)

sharmila k(1)

Shyam Bhatawdekar(1)

sk(1)

soraya nulliah(1)

sp.ajay(1)

Sue(1)

Sujoy Das(1)

sumana Mukhopadhyay(1)

Sumeet(1)

Sunthosh Kumar(1)

suresh kumar(1)

Swaram(1)

Thendral Manoharan(1)

Thommy(1)

Vasudev Ram(1)

Vidya Sury(1)

Vignesh Natarajan(1)

Vishal Velekar(1)

vishesh unni raghunathan(1)

Zubair Abdul Jabbar(1)

अफ़लातून अफ़लू(1)


garland of Languages of India
an amalgamation of the diversified traditions
gracefully presented with novelty
http://www.haaram.com