Java Beans   «Prev  Next»
Lesson 4What does this JavaBeans Tutorial have to offer?
ObjectiveExplore the benefits of learning online.

Java Beans Tutorial Benefits

The Introduction to JavaBeans course is skill-based, which means that you learn by doing.
Many of the course lessons include exercises that require you to
  1. study or write Java code,
  2. compile,
  3. and test the code
before submitting it to the course mentor.

JavaBeans Course project

I will teach you how to develop a complete Bean from scratch that can be reused in your own Java programs.
Throughout the course you will develop individual parts of the Bean, which will make the complete Bean course project. This is a matter of bringing all of your knowledge together into a single development effort. You will be asked to submit your project at the end of this course.
The current module and lesson is indicated at the top of each screen.
For example, you are currently on Module 1 | Lesson 4.


Usage and Applications

JavaBeans provide separate interfaces for design time and run time capabilities. The design time configuration and customization capabilities supported in JavaBeans set them apart from regular Java classes and class libraries. Some JavaBeans are GUI elements such as windows and buttons, some are more complex visual elements such as database viewers or spreadsheets, still others are nonvisual components such as database connections and algorithms. Java Abstract Windowing Toolkit (AWT) is the earliest library of GUI widgets that employ JavaBeans.
AWT was aimed at supporting the development of richer user interfaces for the Web using applets. AWT only provides simple widgets such as a button, a panel, and a window, and has serious performance drawbacks due to its use of heavyweight components for every AWT widget. To overcome the limitations of AWT, the Java Foundation Classes (JFC) library was introduced with a much richer set of widgets (Geary, 1999). Moreover, JFC, also known as Swing, uses an improved lightweight architecture to deliver better performance by using far fewer components per widget . Beans are primarily targeted for use in visual builder tools such as Web page builders, integrated development environments (IDEs), visual application builders, GUI layout builders, and server application builders, although JavaBeans are entirely human-programmable as well. In this context, it is necessary to understand the distinction

public class Circle extends java.awt.Component 
implements java.io.Serializable {
...
// Paint the circle on the screen
public void paint(Graphics g)
...
// Get the boolean Shown property
public boolean isShown()
...
// Get the Radius property
public int getRadius()
...
// Set the Radius property
public void setRadius(int radius) throws PropertyVetoException
...
// Get the Border Size property
public int getBorderSize()
...
// Set the Border Size property
public void setBorderSize(int size)
...
// Add an event listener for change of radius
public void addRadiusChangeListener(RadiusChangeListener l)
throws java.beans.TooManyListenersException
...
// Remove an event listener for change of radius
public void removeRadiusChangeListener(RadiusChangeListener l)
...
// Add an event listener for change of any property
public void addPropertyChangeListener(PropertyChangeListener l)
...
// Remove an event listener for change of any property
public void removePropertyChangeListener(PropertyChangeListener l)
...
// Add an event listener for a vetoable change of any property
public void addVetoableChangeListener(VetoableChangeListener l)
...
// Remove an event listener for a vetoable change of any property
public void removeVetoableChangeListener(VetoableChangeListener l)
...
{


A Moment in Time

The JavaBeans architecture continues to evolve. This course describes the technology in its first release, coinciding with version 1.1 of the Java Development Kit. The concepts and techniques that I cover will continue to be relevant in future Java releases, and new things will no doubt be added along the way. With the rapid rate of change that Java is currently undergoing, the best that any course can do is capture a moment in time.
The next module provides a general description of the component model, followed by an overview of the JavaBeans architecture.