Eclipse closes all shells when one is closed

爷,独闯天下 提交于 2020-02-07 04:05:26

问题


I've a project which is a randomizer. The randomizer gives a random number (of course) which is used to call a random game.

For now, I only have one game.

When I run the randomizer to get the game, everything works and it loads the game flawlessly.

But, when I close the window which was created for the random game, it also closes the parent window which gives the user access to the randomizer.

I am not sure as to why this is happening.

I tried refactoring the name of my shell as well as my display, wondering if this closing was occurring because they shared names, but that didn't fix anything.

I'm not sure why this is happening or what code would prevent this from happening.

Any thoughts would be much appreciated!

Thanks!

Nathan


回答1:


The issue was that there was a JFrame invoking frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);. This was forcing all windows closed. Turning this off fixed the issue.



来源:https://stackoverflow.com/questions/29707413/eclipse-closes-all-shells-when-one-is-closed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!