Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2011
    Posts
    3
    Rep Power
    0

    Question [Please Help] JCreator Error Failed to Find symbol

    Hello, i am very new to JCreator and java in general... i am currently in a class, and our homework assignment was to write a simple program that would do some calculations... after confirming the code i had written in class (on paper) with my teacher i came home and attempted to put it into JCreator after receiving an error and failing multiple times to fix it i was looking for some help

    Here's the code thus far (i removed much of it in an attempt to fix it and its currently like this)

    Java Code:
    import javax.swing.JOptionPane;
    public class calculator {
        public static void main(String[] args)
        	{
        	String value1 = JOptionPane.showInputDialogue("Enter value 1 here");
        }
    }
    and this is the error i am getting

    Java Code:
    --------------------Configuration: <Default>--------------------
    C:\Users\Matthew MacDonald\Documents\JCreator LE\MyProjects\calculator.java:5: cannot find symbol
    symbol  : method showInputDialogue(java.lang.String)
    location: class javax.swing.JOptionPane
            String value1 = JOptionPane.showInputDialogue("Enter value 1 here");
                                       ^
    1 error
    
    Process completed.
    any help would be nice and sooner would be better because i have to email the finished code to my teacher tonight... anyways thanks for any posts

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Oh come on. Did you read the error message?

    You are trying to call a method called "showInputDialogue" in the JOptionPane class. Does that method exist? If you do not know go to the Java API and find out.

  3. #3
    Join Date
    Aug 2011
    Posts
    3
    Rep Power
    0

    Default

    Thanks for your input... didnt know what the error message meant... showInputDialogue doesn't exist as u implied... i am simply following what i learned in the class but i probably copied down my notes incorrectly... (although i did get the teachers confirmation that i had set up the code properly)

    so how do i allow for user input? also the next step in the process according to my teacher would be to turn the inputed value into an int value through this line

    int name = Integer.parseInt(" ")

    with 'name' being what you wanted the integer to be named and the space in between the quotation marks to be replaced with the name of the String value
    is this also incorrect?

    Thank you for your time and sorry im so bad at this :P

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    You have to call a method that exsits. Check carefully how you spelt the method name.

  5. #5
    Join Date
    Aug 2011
    Posts
    3
    Rep Power
    0

    Default

    hey i looked back through the Java API as you suggested and it turns out that the correct line is
    JOptionPane.show.InputDialog("")
    not JOptionPane.show.InputDialogue("")

    Thank you very much for all of your help

  6. #6
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Glad you got it working but remember when in doubt check the API.

Similar Threads

  1. Cannot find symbol error?
    By Josep_16 in forum New To Java
    Replies: 2
    Last Post: 06-19-2011, 07:14 PM
  2. Error: Cannot Find Symbol
    By mawright in forum New To Java
    Replies: 4
    Last Post: 04-14-2011, 02:41 PM
  3. Cannot find symbol error
    By rajivjoshi in forum New To Java
    Replies: 3
    Last Post: 05-31-2010, 10:13 AM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. 'Cannot find symbol' error
    By minihazard10 in forum New To Java
    Replies: 6
    Last Post: 10-10-2008, 04:05 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •