java - Multiple JFrames in a single application -


i have 2 jframes in java code, when close 1 frame second frame closed automatically, please tell how can make them independent of each other?

my code this:

jframe frame1 = new jframe(); jframe frame2 = new jframe();  frame1.setextendedstate(jframe.maximized_both); frame1.setundecorated(true); frame1.setdefaultcloseoperation(jframe.exit_on_close); frame1.setvisible(true);  frame2.setsize(200,100); frame2.setdefaultcloseoperation(jframe.exit_on_close); frame2.setvisible(true); 

it not easy answer, when no code snippet attached.

but assume, have called

jframe.setdefaultcloseoperation(windowconstants.exit_on_close); 

exit_on_close (defined in jframe): exit application using system exit method. use in applications.

in case have change to

windowconstants.dispose_on_close 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -