简体   繁体   中英

Window Close in Swing Application Problem

i have build a swing application and there are 3 frames

frame-1 contains button that open frame-2 and frame3. Now when i click on the close on top right corner in either frame 2 or frame 3 ,the whole application closes(frame 1 too closes)

What shall i do to avoid this ?

对要关闭的帧执行此操作,但不要在关闭它们时关闭整个应用程序:

theFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM