JavaBeans


In computing based on the Java Platform, JavaBeans are classes that encapsulate many objects into a single object. They are serializable, have a zero-argument constructor, and allow access to properties using getter and setter methods. The name "Bean" was given to encompass this standard, which aims to create reusable software components for Java.
It is a reusable software component written in Java that can be manipulated visually in an application builder tool.

Features

;Introspection
;Properties
;Customization
;Events
;Persistence
;Methods

Advantages

The JavaBeans functionality is provided by a set of classes and interfaces in the java.beans package.
InterfaceDescription
AppletInitializerMethods in this interface are used to initialize Beans that are also applets.
BeanInfoThis interface allows the designer to specify information about the events, methods and properties of a Bean.
CustomizerThis interface allows the designer to provide a graphical user interface through which a bean may be configured.
DesignModeMethods in this interface determine if a bean is executing in design mode.
ExceptionListenerA method in this interface is invoked when an exception has occurred.
PropertyChangeListenerA method in this interface is invoked when a bound property is changed.
PropertyEditorObjects that implement this interface allow the designer to change and display property values.
VetoableChangeListenerA method in this interface is invoked when a Constrained property is changed.
VisibilityMethods in this interface allow a bean to execute in environments where the GUI is not available.

JavaBean conventions

In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behaviour. These conventions make it possible to have tools that can use, reuse, replace, and connect Java Beans.
The required conventions are as follows:

package player;
public class PersonBean implements java.io.Serializable

TestPersonBean.java:

import player.PersonBean;
/**
* Class "TestPersonBean".
*/
public class TestPersonBean






Name:

Deceased?




Enter a name:

Choose an option: