Reputation: 2045
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?
Thanks!!
JOptionPane option=new JOptionPane();
option.showOptionDialog(mainFrame, "Choose shape type", null, 0, 0, null, new String [] {"Lines only","Bounded shapes"}, null);
Upvotes: 0
Views: 278
Reputation: 6414
Why you don't use something like this: there is icon option 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);
Upvotes: 2