[英]Error when customising JOptionPane Message Dialog Buttons
I'm receiving the error: no suitable method found for showMessageDialog
when trying to customise a showMessageDialog button to say "Start" instead of OK. 我收到错误:在尝试自定义showMessageDialog按钮以说“开始”而不是“确定”时, no suitable method found for showMessageDialog
。
This is the code: 这是代码:
JOptionPane.showMessageDialog(frame, radioPanel, "Start Game", JOptionPane.PLAIN_MESSAGE, null, new String[]{"Start"});
Could someone point out why I might be receiving this error. 有人可以指出为什么我可能会收到此错误。
Thanks in advance 提前致谢
There are 3 overloads of showMessageDialog
: showMessageDialog
有3个重载:
You are trying to call this method with 6 arguments, so none apply. 您正尝试使用6个参数调用此方法,因此不适用。 You need to carefully read the documentation to decide which one you require. 您需要仔细阅读文档以确定您需要哪个文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.