简体   繁体   English

更改OptionPane对话框的图标

[英]Change Icon of OptionPane dialog

Ok, enough playing guys, today I'm gonna challenge you big: 好吧,足够多的球员,今天我要挑战你:

So I have an option dialog and want to change the icon of the dialog on the right side so instead of showing a default red cross it will show me a question icon. 因此,我有一个选项对话框,想更改右侧对话框的图标,这样,除了显示默认的红叉外,它还会显示一个问题图标。 Is there a basic library in Java that might return me an Icon object for the JOptionPane constructor? Java中是否有基本的库可能会向我返回JOptionPane构造函数的Icon对象?

Thanks!! 谢谢!!

JOptionPane option=new JOptionPane();
option.showOptionDialog(mainFrame, "Choose shape type", null, 0, 0, null, new String [] {"Lines only","Bounded shapes"}, null);

Why you don't use something like this: there is icon option JOptionPane.QUESTION_MESSAGE 为什么不使用这样的东西:有图标选项JOptionPane.QUESTION_MESSAGE

JOptionPane option=new JOptionPane();
option.showOptionDialog(mainFrame, "Choose shape type", null, 0, JOptionPane.QUESTION_MESSAGE, null, new String [] {"Lines only","Bounded shapes"}, null);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM