Lecturers

Na'ama Zahavi
Tal Maoz

Presentation

NetBeans IDE

Abstract

Before we start discussing NetBeans as an IDE we need to fully understand what an IDE is.

An Integrated Developing Environment is a computer software to help computer programmers develop software.

They normally consist of a source code editor , a compiler and/or interpreter , build-automation tools, and (usually) a debugger . Sometimes a version control system and various tools to simplify the construction of a GUI are integrated as well. Many modern IDEs also integrate a class browser , an object inspector and a class hierarchy diagram , for use with object oriented software development. Although some multiple-language IDEs are in use, such as the Eclipse IDE, NetBeans or Microsoft Visual Studio , typically an IDE is devoted to a specific programming language , as in the Visual Basic IDE.

IDEs initially became necessary when doing development in front of a console or terminal. There was a need for a place you could program in front of a terminal and that’s how IDE’s grew. As programing became more large scale and complex there became a growing need for tools such as version control, UI builder, HTML builders (as the Internet became more and more popular) and good debuggers and profilers. That is why today people are referring to an IDE as a program which allows them to do all the developing in one place. By supplying automatic building tools and good intellisense tools, an IDE abstracts many things, makes it a lot easier to learn programing languages and increases the productivity.

As Java became a popular programming language, a good IDE became crucial.

NetBeans started as a project called Xelfi of a group of students from the Check-Republic in 1997, which purpose was to write a Delphi like IDE. The market of java IDE’s was very small those days and this project had a huge success. The original plan was to develop network-enabled JavaBeans components, hens the name. But coming out of the spec for enterprise changed the plans. And the company decided to work with the spec and not against it and NetBeans became a strong java IDE which also made it possible to create JavaBeans for the net very easily. In 1999 Sun decided it needs a powerful IDE for java and written in java and so NetBeans was bought and joined the Sun family. In 2000 Sun came out with the open source IDE NetBeans.
During the first years of NetBeans, it was very popular because it was the only good open source IDE and one of the only good Java IDEs and so it was a big success. It all changed when Eclipse of IBM came into the market on November, 2001. Eclipse very rapidly improved and pretty soon became more powerful than NetBeans specially because as an open source, Eclipse gives much more freedom to the programmer and writing to Eclipse was easier than to write for NetBeans.

That was the situation up until now. These days, there’s the coming out of NetBeans 5.0 gives answer to all the complaints made in the past towards it.

Let’s talk about the new NetBeans and all its features:

  • Has a support for multiple source roots, supplies easy management of libraries, and easily ported to other environments.

  • Supplies easy to use tools for Web programming and supports the J2EE 1.3 and 1.4 standards

  • Supplies an easy to create and deploy and import Java Beans.

  • Contains wizards for creating web services and web services clients, providing the basic (java/wsdl) code needed, and easy to use testing tools of existing web services

  • Provides a visual design editor with end-to-end support for enterprise applications and J2ME development

  • A very sophisticated code editor that has a syntax high-lighter for all the programming languages supported in NetBeans, live parsing, popup javadoc, vary efficient code completion, etc.

  • An advanced refactoring tool.

  • A language independent debugger core with variable modification and watches, various breakpoints and “Fix and continue” mechanism.

  • A new GUI builder

  • A version control support

  • XML, DTD and CSS Text Editor and XML Productivity Tools Wizards to help user generate codes.  

  • A profiler.


The biggest advantage of NetBeans over Eclipse in this new version is the new GUI builder “Matisse”.

Until this GUI Builder, there was no easy way to design user interfaces in java and we all know how important the look and feel of products is crucial in the software world of today. You can see the easy to use wizards and WYSWIG tools in the demos we attached to this site. This is the first time that there’s a GUI tool that can actually compete with the tools of Visual Studio. This is a very big advantage since the GUI builder tools of eclipse are very primitive.

In the new version of NetBeans there’s a very easy to use way to write plugins to it and since it’s an open source this is very important. It still doesn’t give all the freedom that eclipse could allow since it’s constrained to JDK but still, it is more than enough for most programmers.

To summarize, NetBeans gives you a very powerful java based IDE for Java, and much more. It’s strong enough for enterprise programming and saves a lot of developing time leaving the programmer focused on the core.

References

< Link to google's reference >
< Link to NetBeans home page >
< Link to NetBeans in Wikipedia >

Installation
Windows

As expected, installation on NetBeans on a Windows system in nothing more than "Next Next Next"...
Basically, one should go into the NetBeans website, into the download section and download the installer executable.
All that's left is to run the executable and follow the on-screen instructions.

A short clip depicting the entire installation process can be seen here

In the clip, one can see where to download the installations of all NetBeans components and how to install the NetBeans IDE and the NetBeans Profiler.

Linux

Installing under Linux is almost the same as under Windows although it requires a bit more effort.
Of course you should first make sure you have JDK 1.5 installed!
First, one should go into the netbeans website and download the NetBeans installer for Linux.
We will demonstrate the installation of "netbeans-5_0-beta2-bin-linux.bin".
Now, we have to tell the system that this file can be executed: "chmod ugo+x netbeans-5_0-beta2-bin-linux.bin".
Finally, we can run the installer: "./netbeans-5_0-beta2-bin-linux.bin".

You will get the following messages:







Finally, The installer will load and from there, it's the same as under Windows:


Demo
Overview

We've built 2 demos. One is a simple text editor and the other is a simple web application.

To open the demos, simple untar the demo file. It will create a directory. You should run NetBeans and, click File -> Open Project and select the newly created demo folder. Now, you should be able to run the demo by pressing F6.

You can watch a short clip showing the work with Matisse Here.

Simple Editor

This demo is a simple text editor. All you can do is type some text, set the text color and clear all the text. Here are 2 screen shots:



We've commented out some code in the constructor to use the system loon-and-feel. We created this demo on a Linux system with the Gnome desktop manager. On a Windows system, the GUI will look BAD so you can uncomment the code to make Java use the Windows look-and-feel.

The points to note in this demo are the simple creation of a nice GUI with Matisse, the way event handlers are easily assigned to objects' events and very nice result we got with a minimal amount of work. Creating this demo took about 15 minutes!

Once you open the project, move to the "design" view. On the left you will see the class-package diagram on the top and the GUI navigator on the bottom. In the middle you see the form and on the right you see the Widget Pallet on the top and the properties frame on the bottom. It doesn't take much fiddling to get the hang of things and play around with the options.
ENJOY!

simpleEditor.tar

Simple Web Application

This demo is a simple web application. It's made up of two parts: a JSP page and a Servlet. The JSP page "index.jsp" is a simple from that allows the user to enter his name and sends it to the Servlet. The Servlet reads the given name, greets the user and gives a list of all users who visited previously (since the last time the application was restarted).

Here are screen-shots of the JSP page and the Servlet (click to enlarge):





The points to note in this demo is the ease of use and the simplicity of creating web applications. To get the point across, we've added a comment in the jsp page above the form we created to show that all we did was add that form to the jsp page NetBeans automatically created for us. Also, we added /**/ in the beginning of each code line we had to add to the servlet code to get the desired effect. All the rest of the code was created automatically by NetBeans when we created a new servlet in our project.
Note that the form was created using a simple Drag-n-Drop action from the tool pallet on the top right (when looking at the jsp page).

After opening the project, you can go ahead and press F6 to run it. NetBeans will automatically run the bundled Tomcat web-server, open your web browser and will load "index.jsp".
You can play with it a bit and then return to NetBeans and see the wonders that have been added to the bottom frame.
For Example, you can now see that you have the "Bundled Tomcat" tab where you can see what took place when tomcat loaded and cat stop, pause or restart you server.
You can also see the "HTTP Monitor" tab where you can see all the requests sent to you application, all the GET/POST actions, and all details regarding each and every transaction. You can change the details and rerun the transaction and NetBeans will automatically update you browser's display.

simpleWebApplication.tar