Welcome to JavaRanch
NetBeans has its own structure where it puts the classes, so you might have to copy and paste the code.
Don't use NotePad for programming; use something like jEdit, NotePad++ or NotePad2. They are far better for programming.
You find that the javac tool seems to "assume" that the packages have already been compiled. Try compiling the classes nearest the "main" method last, and those "farthest from" the "main" method first.
I note Steve Luke has given some useful advice. You will find more
here in the Java™ Tutorials, and
here, and on JavaRanch similar questions come up every now and again: I found
an old post of my own, with several links in.