Tuesday, 15 March 2011

java - frame setVisible(false) and dispose() can not kill the process -



java - frame setVisible(false) and dispose() can not kill the process -

i have next scenario (2 classes)

frame1(next button) frame2(prev button, close button) frame1 opened (instance 1) go frame1 - frame2 (frame1.setvisible(false) , frame2.setvisible(true)) (instance 2) go frame2 - frame1 (frame2.setvisible(false) , frame1.setvisible(true)) (instance 3) 1 time again frame1 - frame2 (frame1.setvisible(false) , frame2.setvisible(true)) (instance 4)

in above process 4 instances (if programme opened noted instance) during close frame2, m using frame1.dispose() , frame2.dispose() here 2 times instances disposed. problem is: still 2 instances not disposed. only 1 process alive. how possible? in above scenario should dispose instances kill process ?

default value defaultcloseoperation jframe hide_on_close

have set defautlcloseoperation jframe proper value (exit_on_close)

don't create sec or more jframes, utilize cardlayout instead

use jdialog instead jframe, in case there real reasons

java swing jframe

No comments:

Post a Comment