Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0

    Default New to Java, please help.

    Hello,

    i am new to java, and trying to write a simple program to output the sentence "i love java" in a GUI window, but i keep getting this error:

    C:\Users\Behemoth\Desktop\Example1.java:7: error: cannot find symbol
    JOptionPane.showmessageDialoge(null,"i love java");
    ^
    symbol: method showmessageDialoge(<null>,String)
    location: class JOptionPane
    1 error

    Tool completed with exit code 1
    ----------------------------------------------------------------------------------------------------------------------------------------
    This is my code:

    import javax.swing.JOptionPane;
    import java.lang.*;
    public class Example1{
    public static void main(String args[])
    {
    System.out.println("i love java");
    JOptionPane.showmessageDialoge(null,"i love java");
    }
    }


    Thanks in advance

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,856
    Rep Power
    19

    Default Re: New to Java, please help.

    You've mispelled the method (at a guess).
    Here's the API for JOptionPane.
    Note that Java is case sensitive.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0

    Default Re: New to Java, please help.

    Quote Originally Posted by Tolls View Post
    You've mispelled the method (at a guess).
    Here's the API for JOptionPane.
    Note that Java is case sensitive.
    Yep seems like it, Thanks a million.

  4. #4
    harshit shah is offline Member
    Join Date
    Jan 2013
    Location
    Kolkata,India
    Posts
    86
    Rep Power
    0

    Default Re: New to Java, please help.

    i am new to java, and trying to write a simple program to output the sentence "i love java" in a GUI window, but i keep getting this error:
    ????
    i don't seem to understand if you want to print it in GUI window then why is there
    Java Code:
    System.out.println("i love java");
    in your code.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,856
    Rep Power
    19

    Default Re: New to Java, please help.

    Because they want it in both places?
    Or it's debugging code?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    harshit shah is offline Member
    Join Date
    Jan 2013
    Location
    Kolkata,India
    Posts
    86
    Rep Power
    0

    Default Re: New to Java, please help.

    Quote Originally Posted by Tolls View Post
    Because they want it in both places?
    Or it's debugging code?
    Is this answer to my question OR question question from my question.

  7. #7
    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0

    Default Re: New to Java, please help.

    Quote Originally Posted by harshit shah View Post
    ????
    i don't seem to understand if you want to print it in GUI window then why is there
    Java Code:
    System.out.println("i love java");
    in your code.
    I was using it on the CMD first and then tried it on the GUI, it's the same result you just get it in both now lol.

Posting Permissions

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