- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我的 Java 应用程序有问题,我在托盘栏中设置了减少图标的必要条件并设置:
app.getMainFrame().setDefaultCloseOperation(HIDE_ON_CLOSE);
因此,当我关闭任务栏中的应用程序时,应用程序将关闭,但应用程序会继续运行,并且任务栏图标可见。
问题是:如何从任务栏恢复应用程序?
我试过:
app.show(app.getMainView().getFrame());
app.getMainView().getFrame().setVisible(true);
app.getMainView().getFrame()setVisible(true);
但它们都不起作用。
最佳答案
您需要将其恢复到默认状态:
app.getMainFrame().setVisible(true);
app.getMainFrame().setState(Frame.NORMAL);
编辑:使用 JFrame
对此进行了测试,它工作正常。见:
JFrame f = new JFrame("Test");
f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
while (true) {
f.setVisible(true);
f.setState(JFrame.NORMAL);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
这基本上只显示隐藏的 JFrame
。
关于java - 在 HIDE_ON_CLOSE 之后显示 FrameView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8145169/
我正在使用 Netbeans 6.8 制作桌面应用程序。我想做的是以编程方式设置我的应用程序的大小,以便它填满整个屏幕。我环顾四周,这似乎是一个非常讨厌的问题。我一直在尝试显示的代码 here ,但它
Java FrameView有没有类似JFrame.dispose()的东西 我希望在执行某些操作时 FrameView 应该关闭 最佳答案 据我所知,您所说的 FrameView 扩展了 JFram
我的 Java 应用程序有问题,我在托盘栏中设置了减少图标的必要条件并设置: app.getMainFrame().setDefaultCloseOperation(HIDE_ON_CLOSE); 因
我正在构建一个在 WebView 中具有实时预览功能的 HTML 编辑器(objective-C、Mac OS X)。到目前为止一切顺利,几乎获得了我需要的所有功能:两个 View (NSTextVi
我正在尝试使用 NetBeans 编写 GUI 应用程序,但我对此越来越厌倦了...... 我使用 NetBeans 构建了一个“Java 桌面应用程序”。它将主窗体创建为 org.jdesktop.
我们刚刚升级到 Xcode 7,当我们在 9.0 的模拟器中运行我们的电子阅读器应用程序时,它在 WebCore 中崩溃了 WebCore::FrameView::contentsSizeRespec
我使用的是 netbeans 6.9 和 ubuntu。我制作了一个带有 netbeans 向导的简单 Java 桌面应用程序。然后,当我尝试在 Linux 上运行时,jdesktoppane 在应用
我是一名优秀的程序员,十分优秀!