gpt4 book ai didi

java - 程序 'java.ori' 收到 X Window 系统错误

转载 作者:行者123 更新时间:2023-12-04 18:34:43 24 4
gpt4 key购买 nike

我在 Swing 的 Ubuntu 11.10 上有一个桌面应用程序,并且我实现了一项功能,当任何用户单击一个特定按钮时,会打开一个输入对话框并要求用户输入。

public void actionPerformed(ActionEvent e) {
//Shows a input dialog asking the template ID to verify
String id = JOptionPane.showInputDialog(rootPane,
"Enter the Enrolled ID to verify.", "Verify",
JOptionPane.QUESTION_MESSAGE);
}

因此,用户填写值并单击确定按钮,甚至尝试关闭对话框应用程序都会出错并崩溃。

错误:
The program 'java.ori' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 2262 error_code 3 request_code 20 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

谁能帮我解决这个问题?提前致谢。

最佳答案

我相信,rootPane 不适合作为将由 JOptionPane 显示的 JDialog 的父级。它应该是 JFrame 或其他 JDialog。

关于java - 程序 'java.ori' 收到 X Window 系统错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17948740/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com