Welcome to Anythingweb.org  
You are not Logged in! Log in to check your messages.

Today's:
Popular Articles and Posts:

Your First Java Application with Netbeans


Submitted by: web_guy
Hits:333

In this tutorial, you will create your first Java application. I will show you how to create this application with the Netbeans IDE. You can downland Netbeans here. Lets begin!!

Your first step will be into install Netbeans. After you have installed Netbeans, you will want to start it.

Step 1: Next, we will create a new project within Netbeans.

Within Netbeans, click File > New Project > Java > Java Application > Click Next. Change the Project Name to FirstApp. You will also want to change the Main Class to FirstApp (see the image below). After you have completed this, click finished. You will see your new project appear along with a FirstApp.java.



Step 2: Next, you will want to navigate to the FirstApp.java file and open it.

In the left nav (Project Tab) Click on the FirstApp Project > Source Packages > default package > FirstApp.java. Double click on FirstApp.java. See the figure below:



You should see the FirstApp.java file appear. Similar to the image below



Step 3: Add some basic code to your project.

You will now see a main class within FirstApp.java. Add the following code to the main class.

System.out.println("This is my first fava application"); // Display the string.

This code will simple display the text "This is my first java application" in the Netbeans console. Your main class should look similar to what I have below.



Step 4:Compile and run FirstApp class

Now that you have code within your FirstApp class, we will complile and run the class. To do this, right click on FirstApp.java > Run File. In your Netbeans console you will see the output of the file. See my image below.



You have now completed your first Java application with the Netbeans IDE!!!