Java 删除JOptionPane图标

Java 删除JOptionPane图标,java,Java,使用此代码时,不会删除图标 int returnValue = JOptionPane.showOptionDialog(null, "Successfully Updated", "Message", JOptionPane.PLAIN_MESSAGE, 0, null, buttons, buttons[0]); 尚不允许Im上载图像您在错误的参数字段中指定了消息类型 您的代码应该是这样的 int returnValue = JOptionPane.sh

使用此代码时,不会删除图标

int returnValue = JOptionPane.showOptionDialog(null, "Successfully Updated", "Message",
                  JOptionPane.PLAIN_MESSAGE, 0, null, buttons, buttons[0]);

尚不允许Im上载图像

您在错误的参数字段中指定了消息类型

您的代码应该是这样的

int returnValue = JOptionPane.showOptionDialog(null, "Successfully Updated", "Message",
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, buttons, buttons[0]);
“JOptionpane.OK\u CANCEL\u选项”可以更改为您想要的任何选项,我对它进行了一些处理,而您对它的使用似乎并不重要

“新建选项”对话框的外观如下所示(从我使用上述代码运行该对话框时开始)