|
-
error Help!
I am just starting to learn Java and I am using text pad when I try to compile an applet it gives me these errors and according to the book they should not be errors. Unless I am missing something?
Here is the code and errors:
/*
Chapter 2: Welcome to My Day
Programmer: Dickie Taylor
Date: October 4, 2007
Filename: WelcomeApplet.java
Purpose: This project displays a welcome message, the user's
name, and the system date in a console application.
*/
import java.util.Date;
import java.awt.*;
import java.applet.*;
public class WelcomeApplet
{
public void paint(Graphics g)
{
Date currentDate = new Date(); //Date constructor
g.drawString("Welcome to my day!",200,70);
g.drawString("Daily planner for Dickie Taylor",200,100);
g.drawString(currentDate.toString(),200,130);
Image smile; //declare an Image object
smile = getImage( getDocumentBase(),"Smile.gif");
g.drawImage(smile,10,10,this);
setBackground(Color.cyan);
}
}
ERRORS are:
C:\Java\Chapter 2\WelcomeApplet.java:23: cannot find symbol
symbol : method getDocumentBase()
location: class WelcomeApplet
smile = getImage( getDocumentBase(),"Smile.gif");
^
C:\Java\Chapter 2\WelcomeApplet.java:24: cannot find symbol
symbol : method drawImage(java.awt.Image,int,int,WelcomeApplet)
location: class java.awt.Graphics
g.drawImage(smile,10,10,this);
^
C:\Java\Chapter 2\WelcomeApplet.java:25: cannot find symbol
symbol : method setBackground(java.awt.Color)
location: class WelcomeApplet
setBackground(Color.cyan);
^
3 errors
Tool completed with exit code 1
Any help would be very much appreciated.
Thank You,
DLT
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks