Read Articles

Friday, 1 April 2011

The NetBeans Software


When you first run NetBeans, you'll see a screen something like this one:
You may have to drum your fingers and wait a while, as it's not the fastest thing in the world.
To start a new project, click on File > New Project from the NetBeans menu at the top. You'll see the following dialogue box appear:
The New Project Dialogue Box
We're going to be create a Java Application, so select Java under Categories, and then Java Application under Projects. Click the Next button at the bottom to go to step two:
NetBean's New Project Wizard - Step Two
In the Project Name area at the top, type a Name for your Project. Notice how the text at the bottom changes to match your project name (in the text box to the right of Create Main Class):
firstproject.Main
If we leave it like that, the Class will have the name Main. Change it to FirstProject:
Create Main Class
Now, the Class created will be called FirstProject, with a capital "F", capital "P". The package is also called firstproject, but with a lowercase "f" and lowercase "j".
The default location to save your projects appears in the Project Location text box. You can change this, if you prefer. NetBeans will also create a folder with your project name, in the same location. Click the Finish button and NetBeans will go to work creating all the necessary files for you.
When NetBeans returns you to the IDE, have a look at the Projects area in the top left of the screen (if you can't see this, click Window > Projects from the menu bar at the top of the software):
Projects Area in NetBeans
Click the plus symbol to expand your project, and you'll see the following:
Folders in the Project
Now expand Source Packages to see your project name again. Expand this and you'll see the Java file that is your source code.
The Java Source File
This same source code should be displayed to the right, in the large text area. It will be called FirstProject.java. If you can't see a code window, simply double click FirstProject.java in your Projects window above. The code will appear, ready for you to start work.
The coding window that appears should look like this (we've changed the author's name):
The Java coding window
One thing to note here is that the class is called FirstProject:
public class FirstProject {
This is the same name as the java source file in the project window: FirstProject.java. When you run your programmes, the compiler demands that the source file and the class name match. So if your .java file is called firstProject but the class is called FirstProject then you'll get an error on compile. And all because the first one is lowercase "f" and the second one uppercase.
Note that although we've also called the package firsproject, this is not necessary. We could have called the package someprogramme. So the name of the package doesn't have to be the same as the java source file, or the class in the source file: it's just the name of the java source file and the name of the class that must match.
In the next part, you'll learn about Java comments.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.

free counters

Categories

Blog File Sharing Troubleshooting all Computer Troubleshooting How to Operating System Internet Maintanance and Repair ERROR Solutions Help Support Help and Support Device Manager Error Computer Windows Device Applications Install Java Script Computer Repair Java Programe Photoshop Add HTML facebook on site Computer Management Facebook and Site Messenger and Chat Protect Your Computer XFBML and HTML Facebook BELAJAR PHOTOSHOP Shortcut Startup Programs TUTORIAL PHOTOSHOP Windows Administration Tools Create DVD Create DVD Maker Keyboard Network Set Up Security Security System Test DVD Test DVD Drive VGA Card VGA Conector VGA Informations CA-CLIPPER INTERNAL ERROR Crack Create PDF Create PDF using Smart PDF Creator Error windows explorer Hard Drive Partitioning Intall Windows 7 Ultimates Internet Browser Local Area Network Networking PDF EDITOR Protect CD from Copy Router Smart PDF Creator Tutorial Java USB REMOVE Word Password Remover Access Media Collection Adsense Animator Anomymity Computer Hang Computer Icon Computer Set Up D-Link D-Link Router DNS DVD Drive DVD compress Device Drive partitions Drive parts Earn Money Easy Gif Animator Elastomer Eror Solution External Hard Drive Facebook Free Internet Hack Password Hard Drive How to Download Inside Adsense Internet Explore JPEG JPG GIF PNG BMP Laptop Laptop vs PC MS Word to PDF Make DVD Make Money with blog Make Your Own Copy-Protected CD with Passive Protection Modem Ms Word Applications Online Shoping PC Desktop PDF Remover Partitions drive Picture Prevent Windows XP Print Printer Error Reboot Application Remove Pasword Excel Restore Windows Registry Search Engines Optimizer Social Networking Solving Probelm System Registry Upload File to blogger Upload Files Virtual Memory is to Low Viture Windows 7 Windows DVD Maker Wireless Wireless router Words error intall windows explorer cannot open words documents cannot open

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More