Netbeans Java Files

Java files are the files you will be programming in this course. They contain raw Java code.

Creating a Main File

The main file contains the public static void main(String[] args) method. This is a special method which the system runs first when your program starts.

First, click the new button in the menu bar at the top. This will bring up a list of templates for you to use to create a file.

Select the Java Classes -> Java Main Class Template and then click Next.

Next, type the name you want for the file, and check to make sure the filesystem (?)The filesystem is the location that the files are stored in your project. Every project can have multiple filesystems. For more information on filesystems, click here you want to put it in is selected, then click Finish. This will create the default file with no extra pieces added on to it. If, instead, you click Next, you have the option of adding variables, methods, and setting inheritance settings on your class.

Creating an Applet File

An applet file contains the paint method which are run by a web browser when your applet is drawn. It also extends the javax.swing.JApplet

First, click the new button in the menu bar at the top. This will bring up a list of templates for you to use to create a file.

Select the Java Classes -> JApplet Template and then click Next.

Next, type the name you want for the file, and check to make sure the filesystem (?)The filesystem is the location that the files are stored in your project. Every project can have multiple filesystems. For more information on filesystems, click here you want to put it in is selected, then click Finish. This will create the default file with no extra pieces added on to it. If, instead, you click Next, you have the option of adding variables, methods, and setting inheritance settings on your class.