error with making new buttons
Here is the code, in the code I have created a new button called ClickToPlay. Though when I compile this code I receive an error telling me that it cannot find symbol
symbol: constructor Button(java.lang.String)
location: class Button
ClickToPlay =new Button("Click her to play");
Please, someone try to find the error and help me out here, here is the code.
import java.applet.*;
import java.awt.*;
import java.net.*;
public class DrakonTitle extends Applet implements Runnable
{
Font bigFont;
Font NotSoBig;
int xPos = 100;
int yPos = 200;
int radius = 20;
Image ScreenChar;
URL base;
MediaTracker mt;
private Image dbImage;
private Graphics dbg;
public void init()
{
mt = new MediaTracker(this);
bigFont = new Font("Arial",Font.BOLD,100);
NotSoBig = new Font("Arial",Font.BOLD,30);
Button ClickToPlay;
ClickToPlay = new Button("Click here to play");
add(ClickToPlay);
try
{
base = getDocumentBase();
}
catch(Exception e) {}
ScreenChar = getImage(base,"FrontScreenCharacter.jpg");
mt.addImage(ScreenChar,1);
try
{
mt.waitForAll();
}
catch(InterruptedException e)
{}
}
public void start()
{
Thread th = new Thread(this);
th.start();
}
public void stop()
{
}
public void update (Graphics g)
{
if (dbImage == null)
{
dbImage = createImage (this.getSize().width, this.getSize().height);
dbg = dbImage.getGraphics ();
}
dbg.setColor (getBackground ());
dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
dbg.setColor (getForeground());
paint (dbg);
g.drawImage (dbImage, 0, 0, this);
}
public void destroy()
{
}
public void run()
{
while(true)
{
xPos++;
repaint();
try
{
Thread.sleep(17);
}
catch(InterruptedException ex)
{
}
}
}
public void paint(Graphics g)
{
g.setFont(bigFont);
g.drawString("Drakon:",45,100);
g.setFont(NotSoBig);
g.drawString("Lord of Lords",100,160);
g.drawImage(ScreenChar,xPos-radius,yPos-radius,2*radius,2*radius,this);
}
}

