Sun Java Solaris Communities My SDN Account Join SDN
 
Sun Developer Network Newsletters

Generating UML From the NetBeans IDE, 'Hello World' for the NetBeans IDE, Data Transfer and Why to Move to Java EE

 
In This Issue

Welcome to the Java Technology Fundamentals Newsletter

This monthly newsletter provides a way for you to learn the basics of the Java programming language, discover new resources, and keep up-to-date on the latest additions to Sun Developer Network's New to Java Center.

The Java Technology Fundamentals Newsletter is now available in a blog format. Content will appear throughout the month and include extras.

Start reading the Java Technology Fundamentals Blog today!

Note: For the code in this issue of Fundamentals to compile, use the JDK 6 software.

Basic Java Technology Programming
Making Sense of the Java Platform Classes and Tools Annotations
Desktop Java Platform Development
Server-Side Java Platform Development
Java Technology Training
For More Information  
 
Basic Java Technology Programming
Generating UML From the NetBeans IDE  

by John Zukowski

Imagine having been given the source code for a project that needs to be maintained, and the maintainer is long gone. You have the task of adding a new feature. Take a look at what you can discover by using a tool such as the Unified Modeling Language (UML) Modeling module of the NetBeans IDE 5.5 to explore the source code and generate UML diagrams of the system.

The abook.zip file a project designed by Sun Microsystems. It is a basic address-book management system. Using the NetBeans IDE and the UML Modeling module, you'll discover the objects in this application. First, you need to install NetBeans from if you don't have it already.

Launch the NetBeans IDE. By default, the UML Modeling Module is not part of the installation, so you must add that after installing and launching the IDE. Go to the Update Center's Tools menu, then click on Update Center to launch the wizard:

Update Center Wizard
Figure 1. Update Center Wizard

Make sure you have selected the NetBeans Update Center option. When you select Next, the wizard connects to each Update Center for potential modules to add, such as the UML Modeling one. Although you can also install the UML Bank App Sample module, it is the UML Modeling module under Features that you need to install for this article.

UML Modeling Selection
Figure 2. UML Modeling Selection

Although the UML Modeling module is only 10 KB, pressing Add with UML Modeling selected will add not only the selected module but all of its dependencies, totaling over 18 MB in this case.

Include In Install
Figure 3. Include In Install

Press the Next button at the bottom to add all the necessary modules and get the UML Modeling module, after you accept a few licensing agreements.

Download
Figure 4. Download

After the 17 modules, including UML Modeling, are installed, press the Next button to see the list of certificates you must view before installation, and then press Finish. This will prompt you to restart the IDE to install the modules.

Restart
Figure 5. Restart the IDE

You'll see the IDE exit and restart while it installs everything. Once it has restarted, you can now start analyzing the provided source.

To open this project, select the File menu, then the Open Project menu item. You'll need to locate the top-level directory for where you unzipped the ZIP file. For instance, if you unzipped everything to C:\work, select the ABook entry in the C:\work directory, then press the Open Project Folder button. Loading causes a complaint about the derby JAR file not being found. Just click past the problem for now. You're not going to run anything just yet.

Read the rest of this article

Making Sense of the Java Platform Classes and Tools
"Hello World!" for the NetBeans IDE  

These detailed instructions are for users of the NetBeans IDE. The NetBeans IDE runs on the Java platform, which means that you can use it with any operating system for which a JDK 6 is available.

This tutorial covers the following:

  • A Checklist
  • Creating Your First Application
    • Create an IDE Project
    • Add JDK 6 to the Platform List, if necessary
    • Add Code to the Generated Source File
    • Compile the Source File
    • Run the Program
  • Continuing the Tutorial with the NetBeans IDE

Read the tutorial

Desktop Java Platform Development
Trail: Data Transfer  

The Swing toolkit supports the ability to transfer data between components within the same Java application, between different Java applications, and between Java and native applications. You can transfer data by way of a drag-and-drop gesture or by using the clipboard to cut, copy, and paste.

Drag and Drop

You can easily enable drag-and-drop support for many of Swing's components, sometimes with a single line of code. For example, it's trivial to enable drag-and-drop and copy-and-paste support for JTable, Swing's table component. All you need to provide is the data representing the selection and the way to get your data from the clipboard -- that's it.

Cut, Copy, and Paste

Most of the text-based components, such as the Editor pane and text field, support cut, copy and paste out of the box. Of course, menu items need to be created and "wired up" to the appropriate actions. Other components, such as list and tree, can support cut, copy, and paste functions with some minimal work.

PasswordStore supports data transfer in a variety of ways:

  • The text in both the list and the table view supports cut, copy, and paste.
  • The text fields in the Details Panel, the Filter text field, and the Notes text pane support cut, copy, paste, and drag and drop.
  • The Company icon region in the Details panel accepts a dropped image -- jpg, png, gif, or tif.

Read this tutorial

Server-Side Java Development
Why Move to Java EE?  

Java Platform, Enterprise Edition 5 (Java EE 5) is the latest version of the premier platform for developing robust, scalable enterprise applications. Here are some highlights:

  • Easier development. The focus in Java EE 5 is ease of development. With Java EE 5, there is less code to write -- much of the boilerplate code has been removed; defaults are used whenever possible; and annotations are used extensively to reduce the need for deployment descriptors.

  • EJB -- simpler, better. EJB 3.0 makes programming with Enterprise JavaBeans technology simpler through the use of Plain Old Java Objects (POJOs). It also introduces a new persistence API.

  • Enhanced web services. Java EE 5 includes simplified web services support and the latest web services APIs, making it an ideal implementation platform for service-oriented architectures (SOA).

  • JavaServer Faces, JavaServer Pages Standard Tag Library (JSTL), Ajax, and more. Constructing web applications is made easier with JavaServer Faces technology and JSTL. Java EE 5 supports rich thin-client technologies such as Ajax, technologies that are crucial for building applications for Web 2.0.

Read the tutorial

Java Technology Training
Instructor-Led, Self-Paced Web, CD, and Virtual Courses  

  • Object-Oriented Analysis and Design Using UML (OO-226):
    This course progresses through a primer on OO technology and software development methodologies, requirements gathering and analysis (including interviewing stakeholders), system architecture and design, implementation, testing, and deployment.

  • Introduction to Developing Rich-Client Applications (WJO-1107):
    This course defines the concept of a Java technology rich-client application (also known as a Swing application) and describes how to use the Swing API. Students learn how to use the features of the NetBeans IDE for rapid application development. The course demonstrates how to extend the NetBeans platform to build a simple Swing application.

  • Developing Applications for the J2EE Platform (CDJ-310A):
    This course provides students with the knowledge to build and deploy enterprise applications that comply with Java 2 Platform, Enterprise Edition (J2EE) standards. Students are taught how to assemble an application from reusable components and how to deploy an application in the J2EE platform runtime environment.

See the course catalog

For More Information
Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.