I will assume you all are smart enough to figure out how to install the SDK and the Netbeans IDE. If you chose another IDE, good for you! Move on to the next lesson! This lesson is dedicated to the basics of Netbeans. Well, at least I will show you how to set up a project and test run it.
Launch Netbeans if you haven’t done so already. You should get something like this:
Go to File | New Project
In the pop-up window, choose Java in under Categories, then Java Application under Project, then click Next.
In the next screen, fill in a Project Name, choose a Project Location from the Browse button. Check box the Use Dedicated Folder for Storing Libraries option, it will be handy in the future. Make sure both Create Main Class and Set as Main Project are checked. Give your Main Class a name. I’d name it something simple, this is the starting point of your program. Traditionally, the first letter has to be uppercase, and no space in the name. Click Finish when you are done.
Alright, now you should have something like the picture shown above. Note that on the left side, that’s your Project Panel. Basically, all your files for the project will be displayed there. Under Source Packages, you see that I have my HelloWorld.java file right there. Right now you probably don’t know what a Class is, but in the future, if you need to add a new Class, just right-click on the default package, New | Java Class.
To add a new Library, you right-click on the Libraries folder, right click add JAR/Folder…, but also remember that you have to go to the top menu, Tools | Libraries | New Library, then fill out the add JAR/Folder… for the Library Classpath.
But anyway, those will be for a later time. For now, just know that the Green Triangle up top means Run, the Hammer means Build. Clicking Run allow you to run your program. Clicking Build will build you a Jar file that you can distribute for others to run. It is located under the dist folder where you chose your Project Location. Again, that will be discussed later on.