Click to See Complete Forum and Search --> : JOptionPane TitleBar


Xtrme_XJ
11-10-2008, 11:51 AM
I have done this before but it was when I was in my class last year and I am helping a friend with something now... How do I change the title bar of a JOptionPane?

String ans;
ans = JOptionPane.showInputDialog(null, "Choices are:\n(1) Add new employee\n(2) List employees\n" +
"(3) Display infomration about about an employee\n" +
"(4) Display average wage of employees\n(5) Quit\n\n" +
"What is your choice?\n");

chazzy
11-10-2008, 06:29 PM
it's because you're only passing 2 parameters in. The title is exposed as the 3rd parameter in the 4 parameter static method


showInputDialog(Component parentComponent, Object message, String title, int messageType)
Shows a dialog requesting input from the user parented to parentComponent with the dialog having the title title and message type messageType.


http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html