Wednesday, July 29, 2009

Java Programmers aren't BORN

This site shall be my "java container", a collection of my Java-things! I'm an Engineer send me your problem if you have any confusion my address is (raheelkhaliq492002@gmail.com)

Netbeans : Project Folder Structure

How does a Netbeans's project folder look like? Let's see a simple (and usual) case. Create a new project [File]-->[New Project] or [Ctrl+Shift+N]. Select [Categories]-->[Java] and [Projects]-->[Java Application]. Configure the next screen / window as displayed below.


After clicking the "Finish" button, add a line to the code editor (HelloWorld class) to print the message (yes, sure, what else .. the "Hello World" .. :-D )
  1. package javaapplication01;

  2. public class HelloWorld {
  3. public static void main(String[] args) {
  4. System.out.println("Hello World!");
  5. }

  6. }

Now you can inspect and compare the "Files View" as you try to run / build the program.


Some Notes: The project is created and opened in the IDE. You should see the following components:
  • The Projects window, which contains a tree view of the components of the project, including source files, libraries that your code depends on, and so on

  • The Source Editor window with a file called HelloWorld.java open

  • The Navigator window, which you can use to quickly navigate between elements within the selected class

  • The Tasks window, which lists compilation errors as well other tasks that are marked with keywords such as XXX and TODO

Because of the IDE's Compile on Save feature, you do not have to manually compile your project in order to run it in the IDE. When you save a Java source file, the IDE automatically compiles it.

Once you have written and test run your application, you can use the Clean and Build command to build your application for deployment. When you use the Clean and Build command, the IDE runs a build script that performs the following tasks:
  • Deletes any previously compiled files and other build outputs

  • Recompiles the application and builds a JAR file containing the compiled files

No comments:

Post a Comment

How To Perform Hajj

1. Hajj Preparations Hajj begins on the 8th day of Dhu al-Hijjah, when pilgrims make their intentions to undertake the pilgrimage by do...