This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

to be more specific  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to be more specific i want to use my own custom icon in a JOptionPane.showInputDialog dialog..
i have had loads of contacts telling me how to do it using java.awt.Frame..however my usage is of the type:
String answer;
answer =
JOPtionPane.showInputDialog(
"Please enter the current date");
now can you see the problem?
i know examples such as:
ImageIcon ico = new ImageIcon("drag2.jpeg");
Frame frame = new Frame();
Object[] options = {"Yes, please",
"No, thanks",
"No eggs, no ham!"};
JOptionPane.showInputDialog(frame,
"What some eggs ?.", "My title",JOptionPane.ERROR_MESSAGE,ico,options, options[2]);
will work but that isn't a usefull input style for
my proggie
can anyone help please pretty please
adambi
 
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String[] options = {"Yes, please", "No, thanks",
"No eggs, no ham!"};
Icon ico = new ImageIcon("drag2.jpeg");
JOptionPane.showInputDialog(null, What some eggs ?.", "My Title", JOptionPane.ERROR_MESSAGE, ico, options, options[2]);
What about it is not a useful style?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!