You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

InternalWindow调用close()致应用退出问题咨询(v1.7.15起出现)

Fixing the Issue Where InternalWindow.close() Exits the Entire App

Hi there! Sorry to hear you're stuck with this frustrating problem—ever since version 1.7.15, calling close() on your modal InternalWindow is shutting down the whole application instead of just closing the window itself. Let’s go through some practical fixes and checks to get this sorted:

  • Verify InternalWindow Initialization & Parent Association
    First, double-check how you’re creating and linking your InternalWindow to the main application window. In many UI frameworks, version 1.7.15 might have adjusted how modal windows handle parent/owner relationships. If your InternalWindow isn’t properly tied to a parent container, calling close() could accidentally trigger the main app’s shutdown logic. Make sure you set the correct owner/parent during initialization, like this example:

    InternalWindow modalWindow = new InternalWindow();
    modalWindow.setOwner(mainApplicationWindow); // Link to your main window instance
    modalWindow.setModal(true);
    
  • Use a Safer Alternative to close()
    Some framework updates in 1.7.15 might have altered how the close() method behaves for modal InternalWindows—sometimes it triggers a default shutdown hook that’s meant for the main window, not child modals. Try using dispose() instead, or manually hide the window before releasing resources:

    modalWindow.setVisible(false);
    modalWindow.dispose();
    
  • Check Version Changelogs & Update the Framework
    Since this started in 1.7.15, look up the official changelog for that version to see if there were intentional changes to InternalWindow or modal window handling. It’s possible this is a known bug that’s been fixed in subsequent minor releases (like 1.7.16 or later). Upgrading to the latest stable version might resolve the issue entirely.

  • Intercept the Window Closing Event
    You can add a listener to your InternalWindow to manually control the closing behavior and prevent the event from propagating to the main application. Here’s how you might implement that:

    modalWindow.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            e.consume(); // Stop the default closing action from spreading
            modalWindow.setVisible(false);
            // Add any cleanup logic you need here
        }
    });
    

Hope one of these solutions gets your app behaving as expected again!

内容的提问来源于stack exchange,提问作者thlinde

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:09:59