joptionpane - errors with java on eclipse -
what doing wrong , how fix it? i'm running on eclipse.
import java.awt.component; import javax.swing.icon; public class joptionpane { public static void main(string[] args) { // joptionpane inputs component parentcomponent = null; object message = "what think of hudson?"; string title = "very important!"; string choice1 = "1"; string choice2 = "2"; string choice3 = "3"; int optiontype = joptionpane.yes_no_option; int messagetype = joptionpane.error_message; icon icon = null; // joption pane display object[] options = { choice1, choice2, choice3 }; int option = joptionpane.showoptiondialog(parentcomponent, message, title, optiontype, messagetype, icon, options, options[2]); // switch switch (option) { case 0: //button 1 result break; case 1: //button 2 result break; default: //button 3 result break; } return; } } the errors:

your class name conflicting javax.swing.joptionpane - rename else can import class
Comments
Post a Comment