I didn't think I'd be asking for help with the first example in my book! I'm using Head First Java v2. I have installed java5 (1.6) on my ubuntu linux laptop. The short program is as follows:
import java.awt.*;
import java.awt.event.*;
class Party{
public void buildInvite(){
Frame f=newFrame();
Label l=newLabel("Party at Tim's");
Button b=newButton("You Bet");
Button c=newButton("Shoot Me");
Panel p=newPanel();
p.add(l);
} //more code here...
The errors when I try to compile using javac are:
mark@personalpc:~/HeadFirst$ javac Party.java
Party.java:7: cannot find symbol
symbol : method newFrame()
location: class Party
Frame f=newFrame();
^
Party.java:8: cannot find symbol
symbol : method newLabel(java.lang.String)
location: class Party
Label l=newLabel("Party at Tim's");
^
Party.java:9: cannot find symbol
symbol : method newButton(java.lang.String)
location: class Party
Button b=newButton("You Bet");
^
Party.java:10: cannot find symbol
symbol : method newButton(java.lang.String)
location: class Party
Button c=newButton("Shoot Me");
^
Party.java:11: cannot find symbol
symbol : method newPanel()
location: class Party
Panel p=newPanel();
^
5 errors
I am assuming this means the compiler cannot find the import modules (?).
If this is the case, I can't find a file on my system called java.awt.
I do have a ham radio logging program that runs in the VM so I assume my environment is set up ok.
Thanks for any help.
Mark
import java.awt.*;
import java.awt.event.*;
class Party{
public void buildInvite(){
Frame f=newFrame();
Label l=newLabel("Party at Tim's");
Button b=newButton("You Bet");
Button c=newButton("Shoot Me");
Panel p=newPanel();
p.add(l);
} //more code here...
The errors when I try to compile using javac are:
mark@personalpc:~/HeadFirst$ javac Party.java
Party.java:7: cannot find symbol
symbol : method newFrame()
location: class Party
Frame f=newFrame();
^
Party.java:8: cannot find symbol
symbol : method newLabel(java.lang.String)
location: class Party
Label l=newLabel("Party at Tim's");
^
Party.java:9: cannot find symbol
symbol : method newButton(java.lang.String)
location: class Party
Button b=newButton("You Bet");
^
Party.java:10: cannot find symbol
symbol : method newButton(java.lang.String)
location: class Party
Button c=newButton("Shoot Me");
^
Party.java:11: cannot find symbol
symbol : method newPanel()
location: class Party
Panel p=newPanel();
^
5 errors
I am assuming this means the compiler cannot find the import modules (?).
If this is the case, I can't find a file on my system called java.awt.
I do have a ham radio logging program that runs in the VM so I assume my environment is set up ok.
Thanks for any help.
Mark