Results 1 to 3 of 3

Thread: Help Please

  1. #1
    djpg2000 is offline Member
    Join Date
    Sep 2008
    Posts
    3
    Rep Power
    0

    Question Help Please

    Can someone tell me what I'm doing wrong?

    Java 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)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default

    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.

  3. #3
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    7

    Default

    Man and where di you define the location of the String whcih should be drawn in Applet?
    Java 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);
    Last edited by serjant; 09-17-2008 at 04:46 PM.

Posting Permissions

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