开发者

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 co开发者_开发知识库rner in either frame 2 or frame 3 ,the whole application closes(frame 1 too closes)

What shall i do to avoid this ?


Do this for the frames you want to close but do not want the whole application to close when you close them:

theFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜