hi Guys,
Just started java and so far not too bad but i tried to sort out packages today and got this error. Stuck on it for hours. I'm not sure if im importing or setting up the pacakages properly but that where I'm hoping you can help... Im dealing with swing. il post both classes. Hopefully you can see what I have done wrong. P.S. The classpath and jdk are set properly(I think....)
CLASS 1
package myJava.SimpleFrame.SimpleFrameDriver;
import java.awt.*;
import javax.swing.*;
import myJava.SimpleFrame.*;
public class SimpleFrameDriver
{
public static void main(String[] args)
{
SimpleFrame sFrame1 = new SimpleFrame();
SimpleFrame sFrame2 = new SimpleFrame();
sFrame1.showIt("SimpleFrame 1");
sFrame2.showIt("SimpleFrame 2", 300,300);
}
}
CLASS 2
package myJava.SimpleFrame.SimpleFrame;
import java.awt.*;
import javax.swing.*;
import myJava.SimpleFrame.*;
public class SimpleFrame extends JFrame
{
public SimpleFrame()
{
this.setSize(200,200);
this.setLocation(200,200);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
//MAKE THE FRAME VISIBLE
public void showIt()
{
this.setVisible(true);
}
//MAKES THE FRAME VISIBLE AND SETS THE TITLE TEXT.
public void showIt(String title)
{
this.setTitle(title);
this.setVisible(true);
}
public void showIt(String title,int x, int y)
{
this.setTitle(title);
this.setLocation(x,y);
this.setVisible(true);
}
//MAKES THE FRAME INVISIBLE.
public void hideIt()
{
this.setVisible(false);
}
}
and the error is:
SimpleFrameDriver.java:12:cannot find symbol
symbol: class SimpleFrame
loaction:class myJava.SimpleFrame.SimpleFrameDriver.SimpleFrameDriver
SimpleFrame sFrame2 = new SimpleFrame();