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

Eclipse中JOptionPane对话框无法正常显示的解决求助

JOptionPane Dialog Fails to Display in Eclipse 2019-09 (Java 12.0.2, Windows 10)

I'm stuck with a frustrating issue where JOptionPane dialogs refuse to show up at all when running my Java code in Eclipse 2019-09. I'm working with Java 12.0.2 on Windows 10 Home 1903, and even the simplest test case won't display the dialog window—no errors are thrown, but the dialog just never appears.

Environment Details

  • Eclipse version: 2019-09 (tried downgrading to 2019-06 with no improvement)
  • Java version: 12.0.2
  • OS: Windows 10 Home 1903
  • Eclipse launch command (retrieved via "Show Command Line" button):
    C:\Program Files\Java\jdk-12.0.2\bin\javaw.exe -Dfile.encoding=UTF-8 -classpath "C:\Users\Michael\eclipse-workspace\test\bin" test.test
    

Steps I've Already Tried (All Unsuccessful)

  • Switched to an older Eclipse version (2019-06)
  • Renamed both the test file and class name to rule out naming conflicts
  • Moved my Eclipse workspace to a completely new directory
  • Forced OpenGL rendering through Nvidia Control Panel using my dedicated GPU
  • Added JDK\bin to the system PATH and properly configured the JAVA_HOME environment variable

Minimal Test Code

Here's the simple program I'm using to reproduce the issue:

package test;
import javax.swing.JOptionPane;
public class test {
    public static void main(String[] args) {
        JOptionPane.showMessageDialog(null, "test");
    }
}

Running this code results in the dialog failing to appear, with no visible errors or logs to indicate what's going wrong.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.14 08:16:53