Applet, use seperate class
Hi I am making a applet that uses a seperate class, but my IDE tells me
that when I try to use my seperate class, that it cannot resolve the
symbol (ie cant find it) ,or if I try to import the class, that it
expects a '.'. Here's the code
import java.awt.*;
public class Buiding
{
private int width, height, topBuffer, sideBuffer, widthOfWindow,
heightOfWindow,
heightOfThird;
public Buiding(int width, int height)
{
this.width = width; this.height = height;
topBuffer = height/20;
sideBuffer = width/20;
widthOfWindow = width/10;
heightOfWindow = height/10;
heightOfThird = height/3;
}
public void draw(int x, int y, Graphics page)
{
int origionalX = x, origionalY = y;
page.drawRect(x, y, width, height);
int randomXWidth = x - widthOfWindow;
int randomX = (int)(Math.random()*randomXWidth);
int randomYWidth = y + heightOfThird - 2*topBuffer -
heightOfWindow;
int randomY = (int)(Math.random()*randomYWidth);
randomX += x;
randomY += y;
page.fillRect(randomX,randomY,widthOfWindow,heightOfWindow);
}
}
import java.applet.Applet;
import java.awt.*;
import Building; //stops here
public class test extends Applet
{
private Building test; // or here if the above line is not there
public void init()
{
test = new Building(100,100);
}
public void paint(Graphics g)
{
test.draw(10,10,g);
}
}
Thanks for any help