Results 1 to 4 of 4
  1. #1
    EmJay is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default Need help with a few errors

    I'm fresh into Java coding, so fresh that I'm sure those reading will find this error to be a no brainer, but I can't fix it for the life of me. I'm converting an application to an applet, and the book I'm using to help me learn has me use the techniques that you'll be seeing.

    My code looks like this,

    Java Code:
    public class SplashApplet extends Applet
    {
    	public void paint(Graphics g)
    	{
    
    		g.drawString("\t\t\tMy Name");
    		g.drawString("\t\t\tMy Address");
    		g.drawString("\t\t\tMy home city");
    
    	}
    }
    The errors I receive are these,

    Java Code:
    C:\Users\---\SplashApplet.java:9: cannot find symbol
    symbol: class Applet
    public class SplashApplet extends Applet
                                      ^
    C:\Users\---\SplashApplet.java:11: cannot find symbol
    symbol  : class Graphics
    location: class SplashApplet
    	public void paint(Graphics g)
                              ^
    2 errors
    
    Tool completed with exit code 1
    I honestly cannot figure this out.

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    You forgot import need classes.
    import java.applet.*;
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    Debugger is offline Member
    Join Date
    Jan 2011
    Posts
    27
    Rep Power
    0

    Default

    your missing the proper imports

  4. #4
    EmJay is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default

    Ahhhhh how silly of me, now it's as plain as day.

    Thanks for the help.

Similar Threads

  1. Replies: 4
    Last Post: 01-04-2011, 01:36 AM
  2. errors
    By santosh chauhan in forum New To Java
    Replies: 5
    Last Post: 07-26-2010, 08:59 PM
  3. Help with three errors -.-
    By Insomniac Riot in forum New To Java
    Replies: 5
    Last Post: 03-30-2010, 07:52 PM
  4. errors
    By ravikumar in forum Threads and Synchronization
    Replies: 3
    Last Post: 09-29-2009, 05:15 AM
  5. Replies: 3
    Last Post: 03-08-2009, 02:51 AM

Posting Permissions

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