-
Help Please
Can someone tell me what I'm doing wrong?
Code:
/*
Chapter 2: Runyon Corporation
Programmer: Dean Priovolos
Date: September 17, 2008
Filename: SplashApplet.java
Purpose: This project displays the name,address, and
web page address in a console application.
*/
import java.awt.*;
import java.applet.*;
public class SplashApplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("\t\t\tThe Runyon Corporation");
g.drawString("\t\t\t233 West Main Suite 207");
g.drawString("\t\t\tConcord, Indiana 46112");
g.drawString("\t\t\tw.w.w.RunyonCorp.c.o.m"); // display web addres
g.drawString();
}
}
I get the error: cannot find symbol - method drawString(java.lang.String)
-
Is that the full text of the error message? Please copy ALL of the error message here. Don't edit it.
Read the API doc for the Graphics class's drawString method.
-
Man and where di you define the location of the String whcih should be drawn in Applet?
Code:
import java.awt.*;
import java.applet.*;
public class SplashApplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("\t\t\tThe Runyon Corporation",10,20);
g.drawString("\t\t\t233 West Main Suite 207",20,20);
g.drawString("\t\t\tConcord, Indiana 46112",10,20);
g.drawString("\t\t\tw.w.w.RunyonCorp.c.o.m",30,20); // display web addres
}
There is no such method drawString(String) in Graphics
There is a method:drawString(String,int x,int y);