Maybe this is a very dumb question but my teacher sends us files with .java extension, which I can read with wordpad.

I need a way to upload it to Netbeans quickly. What I did is:
a) New Project - Created new project with the package name written in java file.
b) New File - Java Class: Create different classes for each class created in java file, incluiding main file.
c) Copying in each class (copy-paste) the code written for each class.

This was annoying and susceptible to mistakes, so if there is a better way to upload java files to netbeans (from a .java file) please tell me.