Sun Java Solaris Communities My SDN Account Join SDN
 
Java Technology Fundamentals Newsletter Index

Using Regular Expressions, Actions, and Learn to Package and Deploy

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.

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

Basic Java Technology Programming
Making Sense of the Java Classes & Tools
Desktop Java Platform Development
Server-Side Java Platform Development
What's New on the Sun Java Studio Creator IDE
Tutorials & Tips From NetBeans.org
Free Developer Tools
Java Technology: Self-Paced, Virtual, and Instructor-Led Courses
For More Information

 
Basic Java Technology Programming

Regular Expressions -- Introduction

What Are Regular Expressions?

Regular expressions are a way to describe a set of strings based on common characteristics shared by each string in the set. They can be used to search, edit, or manipulate text and data. You must learn a specific syntax to create regular expressions -- one that goes beyond the normal syntax of the Java programming language. Regular expressions vary in complexity, but once you understand the basics of how they're constructed, you'll be able to decipher (or create) any regular expression.

This trail teaches the regular expression syntax supported by the java.util.regex API and presents several working examples to illustrate how the various objects interact. In the world of regular expressions, there are many different flavors to choose from, such as grep, Perl, Tcl, Python, PHP, and awk. The regular expression syntax in the java.util.regex API is most similar to that found in Perl.

Read the rest of this article

Making Sense of the Java Classes & Tools

How to Use Actions

If you have two or more components that perform the same function, consider using an Action object to implement the function. An Action object is an action listener that provides not only action-event handling but also centralized handling of the state of action-event-firing components such as toolbar buttons, menu items, common buttons, and text fields. The states that an action can handle includes text, icon, mnemonic, and enabled status.

You typically attach an action to a component using the setAction method. Here's what happens when setAction is invoked on a component:

  • The component's state is updated to match the state of the Action object. For example, if the Action object's text and icon values were set, the component's text and icon are set to those values.

  • The Action object is registered as an action listener on the component.

  • If the state of the Action changes, the component's state is updated to match the Action. For example, if you change the enabled status of the action, all components it's attached to change their enabled states to match the action.

Read the rest of this tutorial
 

Desktop Java Platform Development

Introduction to Developing General Applications for the Java Platform

Each month, this section highlights articles and tutorials to teach you about the Java technologies involved in desktop application development and the tools you can use to create various types of desktop applications.

Last month, you read a summary of the many Java technologies that you can use in desktop applications. This month, you get an introduction to the NetBeans IDE so that in months to come, you can learn how to build a word processor using various Java technologies and APIs with the NetBeans IDE, which speeds up the process of creating code.

The tutorial "Introduction to Developing General Java Applications" takes you through some of the basic steps of developing a Java SE technology-based application in NetBeans IDE 5.5. You will create a MyLib project with a utility class, then create a MyApp project with a main class that implements a method from the library project.

Read this tutorial
 

Server-Side Java Platform Development

Java Technologies to Use in Web Applications

Each month, this section will highlight articles to get you familiar with the Java technologies involved in server-side development and the tools you can use to create various types of web applications.

This month, learn about the Java technologies that go into building web applications. You can find web applications everywhere on the Internet. Many of these web applications are used to process online forms, tally voting polls, take orders within online stores, allow users to book a flight for their next business trip, or simply to display the user's login name. Which Java technologies do you need to create a web application and which packages do you need to import? The answer depends on what kind of application you're building and what it does.

This article provides an overview of the Java technologies involved in creating various types of web applications, tells you when you might decide to use them, and provides links to get you started. Future articles will cover how to use these technologies in building web applications. To use the technologies described in this article, download Java Development Kit (JDK) 5.0 Update 9 with Java Platform, Enterprise Edition (Java EE) or later and install it on your computer: http://java.sun.com/javase/downloads/

Before you begin coding, you need to understand what a web application is, what Java technologies are available for use, and what development tools can save you time and make creating applications easier.

Contents

What Is a Web Application?
Java Technologies Used in Web Applications
Other Technologies to Consider
Development Tools

Read this article

What's New on the Sun Java Studio Creator IDE

Using the Java Editor

The Sun Java Studio Creator IDE provides a full featured Java Editor. This tutorial shows you some of its more useful features. As you become more familiar with using the Java Editor, refer to the IDE's Help menu for a deeper understanding of its capabilities. To display help for the Java Editor, open the editor and press F1.

Read the tutorial

Tutorials and Tips on NetBeans.org

Packaging and Deploying Desktop Java Platform Applications

One question that a lot of beginning programmers have is: "Now that I've created my application in the IDE, how do I get it to work from the command line outside of the IDE?" Similarly, someone might ask, "How do I distribute this application to other users without having to give them the whole IDE as well?"

The answers to these questions are relatively simple but not necessarily obvious. This document addresses those questions by taking you through the basics of using NetBeans IDE 5.0 to prepare your applications for distribution and then deploying those applications. In addition, this document provides information that you might need to configure your system (or that you might need to pass on to the users of your application). We will show a few different approaches for deploying an application so that users can access the application by doing the following:

  • Double-clicking the application's Java Archive (JAR) file
  • Calling the application from the command line
  • Calling the application from a script file

Along the way, we will cover some basics of JAR file structure and learn how IDE projects deal with JAR files.

Read the tutorial and do the exercises
 

Free Developer Tools

Sun is offering the award-winning Sun Java Studio Enterprise and Sun Java Studio Creator IDEs at no cost to all developers worldwide who join the Sun Developer Network (SDN).

Get your free tools

Java Technology: Self-Paced, Virtual, and Instructor-Led Courses

Self-Paced, Virtual, and Instructor-Led Courses

Enhance your developer skills with cutting-edge technologies. Sun's comprehensive offerings enable rapid development of applications and web services. Get trained and certified in the Java platform APIs, learn to use the power of Java technology to create web services.

Course Catalog

For More Information