when i try to compile this simple skeleton for a start of a program do I get the follwing error:
MyApp.java [21:1] cannot resolve symbol
symbol : constructor MyCode (MyGUI)
location: class MyCode
mc = new MyCode(mg);
why can I not pass MyGui to MyCode?
thanks
Hugh
public class MyApp{
public MyApp(){
MyCode mc = null;
MyGUI mg = new MyGUI();
mc = new MyCode(mg);
}
public static void main(
String args[]){
MyApp ma = new MyApp();
}
}
public class MyCode {
private MyGUI mgl;
public MyCode(MyGUI mg) {
mgl=mg;
}
}
public class MyGUI{
private JButton testButton;
private JButton testButton2;
private JPanel panel1;
public MyGUI() {
JFrame f = new JFrame();
testButton = new JButton("Test...");
testButton2 = new JButton("Test2...");
panel1= new JPanel();
panel1.add(testButton);
panel1.add(testButton2);
f.getContentPane().add(panel1);
f.pack();
f.show();
}
}
MyApp.java [21:1] cannot resolve symbol
symbol : constructor MyCode (MyGUI)
location: class MyCode
mc = new MyCode(mg);