Error Cannot Find Symbol Joptionpane.showmessagedialog
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up JOptionPane Cannot Find Symbol up vote 0 down vote favorite Please, Please help me! I am desperate. import javax.swing.JOptionPane; public class Calculator { public static void main ( String args[] ) { double n1 = Double.parseDouble(JOptionPane.showInputDialog(" Enter first number: ")); double n2 = Double.parseDouble(JOptionPane.showInputDialog(" Enter second number: ")); String x = JOptionPane.showInputDialog("Enter operator: "); double result; if (x == "+"){ result = (n1 + n2); JOptionPane.showMessageDialog(n1, "+", n2,"=", result); } else if (x == "-"){ result = (n1 - n2); JOptionPane.showMessageDialog(n1,"-", n2,"=", result); } else if (x == "/"){ result = (n1 / n2); JOptionPane.showMessageDialog(n1,"/", n2,"=", result); } else if (n2 == 0){ JOptionPane.showMessageDialog(null, "Cannot divide by 0"); } else if (x == "*"){ result = (n1 * n2); JOptionPane.showMessageDialog(n1,"*", n2,"=", result); } else if (x == "%"){ result = (n1 % n2); JOptionPane.showMessageDialog(n1,"%", n2,"=",(n1%n2)); } } } My code brings up these compiling errors: 5 errors found: File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 14] Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:14: cannot find symbol symbol : method showMessageDialog(double,java.lang.String,double,java.lang.String,double) location: class javax.swing.JOptionPane File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 19] Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:19: cannot find symbol symbol : method showMessageDialog(double,java.lang.String,double,java.lang.String,
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask http://stackoverflow.com/questions/26261085/joptionpane-cannot-find-symbol Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up JOptionPane Method Not found up vote 0 down vote favorite Here's my code: import javax.swing.JOptionPane; http://stackoverflow.com/questions/29804431/joptionpane-method-not-found import javax.swing.*; import java.net.*; import java.*; public class icmp { public static void main(String args[]) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) {} int time = 0; while (true) { time = Integer.parseInt(JOptionPane.showInputDialog("enter a time")); break; } time = time * 1000; String str = JOptionPane.showInputdialog("Enter the IP address"); try { InetAddress addr = InetAddress.getByName(str); boolean test = addr.isReachable(time); if (test) { JOptionPane.showMessageDialog(null, str + " Host isConnected", "Alert", JOptionPane.ERROR_MESSAGE); } else { JOption.showMessageDialog(null, str + "Host is not Connected", "Alert", JOption.ERROR_MESSAGE); } } catch (Exception e) {} } } And here are the errors I'm getting: icmp.java:23: error: cannot find symbol String str = JOptionPane.showInputdialog("Enter the IP address"); ^ symbol: method showInputdialog(String) location: class JOptionPane icmp.java:34: error: cannot find symbol JOption.showMessageDialog(null,str+ "Host is not Connected","Alert",JOption.ERROR_MESSAGE); ^ symbol: variable JOption location: class icmp icmp.java:34: error: cannot find symbol JOption.showMessageDialog(null,str+
Help Suggestions Send Feedback Answers Home All Categories Arts & Humanities Beauty & Style Business & Finance Cars & Transportation Computers & Internet Consumer Electronics Dining Out Education & Reference https://answers.yahoo.com/question/index?qid=20120219205123AAo7Mub Entertainment & Music Environment Family & Relationships Food & Drink Games & Recreation Health Home & Garden Local Businesses News & Events Pets Politics & Government Pregnancy & Parenting Science & Mathematics Social Science Society & Culture Sports Travel Yahoo Products International Argentina Australia error cannot Brazil Canada France Germany India Indonesia Italy Malaysia Mexico New Zealand Philippines Quebec Singapore Taiwan Hong Kong Spain Thailand UK & Ireland Vietnam Espanol About About Answers Community Guidelines Leaderboard Knowledge Partners Points & Levels Blog Safety Tips Computers & Internet Programming & Design Next error cannot find JOptionPane issue it says cannot find symbol? ElapsedTimeCalculator one = new ElapsedTimeCalculator(1445,1730) ;//joptioninput String input = JOptionPane.showInputDialog("Enter the start time in military " + "format:") ; int starttime= Integer.parseInt(input) ; String input2 = JOptionPane.showInputDialog("Enter... show more ElapsedTimeCalculator one = new ElapsedTimeCalculator(1445,1730) ;//joptioninput String input = JOptionPane.showInputDialog("Enter the start time in military " + "format:") ; int starttime= Integer.parseInt(input) ; String input2 = JOptionPane.showInputDialog("Enter the end time in military " + "format:") ; int endtime = Integer.parseInt(input2) ; Update: i figured it out i just had to import the package for JOptionPane Follow 1 answer 1 Report Abuse Are you sure you want to delete this answer? Yes No Sorry, something has gone wrong. Trending Now Daniela Ryf Gennifer Flowers Dwayne Wade Bella Hadid Katy Mixon Car Insurance Mike Tyson Clay Matt