• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Studying from Head First Java (2nd Ed.)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I have literally just started reading the book, and I am stuck at the first lesson. The lesson has you create a small applet (if that's the right term) that acts as a party invitation. The problem that I am having is that the compiler is returning 'Symbol Not Found Error' on things such as capital letters, and even periods.

My code (copied directly from the book, line for line)


And the compiling error

If someone could explain what is happening (with some detail, I'm a beginner remember ;) ) and what I could do to fix it, I would greatly appreciate it.
 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bryce, Welcome to Ranch

You have imported the packages incorrectly. It should have been



As you can see the * which means you are importing all the classes from the awt and event package.

If you need to import only a single class from a package then it would be written like this



Here only the Frame class would be imported from awt package
 
Marshal
Posts: 80747
486
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Beware of the Party example from HFJ; it is incomplete and cannot be executed in its current form. It is usually considered better form to list all the classes you are importing, even if you have several lines starting
import foo.bar.…
 
reply
    Bookmark Topic Watch Topic
  • New Topic