Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword or section
Like this
P. 1
Notes on JavaBeans

Notes on JavaBeans

|Views: 2,113|Likes:
Published by nagraj_ciet
lecture notes on java beans
lecture notes on java beans

More info:

Published by: nagraj_ciet on Nov 30, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





The JavaBeans™ architecture is based on a component model which enables developersto create software units called
. Components are self-contained, reusablesoftware units that can be visually assembled into composite components, applets,applications, and servlets using visual application builder tools. JavaBean components areknown as
.A set of APIs describes a component model for a particular language. The JavaBeans API
describes the core detailed elaboration for the JavaBeans componentarchitecture.Beans are dynamic in that they can be changed or customized. Through the design modeof a builder tool you can use the Properties window of the bean to customize the bean andthen save (persist) your beans using visual manipulation. You can select a bean from thetoolbox, drop it into a form, modify its appearance and behavior, define its interactionwith other beans, and combine it and other beans into an applet, application, or a new bean.The following list briefly describes key bean concepts.
Builder tools discover a bean's features (that is, its properties, methods, andevents) by a process known as
. Beans support introspection in twoways:
By adhering to specific rules, known as
design patterns
, when naming bean features. The
 class examines beans for these design patterns to discover bean features. The
class relies on the
core reflection
API. The trailThe Reflection APIis an excellent place tolearn about reflection.
By explicitly providing property, method, and event information with arelated
bean information
class. A bean information class implements the
interface. A
class explicitly lists those bean featuresthat are to be exposed to application builder tools.
are the appearance and behavior characteristics of a bean that can bechanged at design time. Builder tools introspect on a bean to discover its properties and expose those properties for manipulation.
Beans expose properties so they can be customized at design time.
is supported in two ways: by using property editors, or by using moresophisticated bean customizers.
Beans use
to communicate with other beans. A bean that is to receiveevents (a listener bean) registers with the bean that fires the event (a source bean).Builder tools can examine a bean and determine which events that bean can fire(send) and which it can handle (receive).
enables beans to save and restore their state. After changing a bean's properties, you can save the state of the bean and restore that bean at a later time
with the property changes intact. The JavaBeans architecture uses Java ObjectSerialization to support persistence.
A bean's
are no different from Java methods, and can be called fromother beans or a scripting environment. By default all public methods areexported.Beans vary in functionality and purpose. You have probably met some of the following beans in your programming practice:
GUI (graphical user interface)
 Non-visual beans, such as a spelling checker 
Animation applet
Spreadsheet application
Lesson: Using the NetBeans GUI Builder
his lesson explains how to use the NetBeans IDE GUI Builder to work with beans. In preparation for working with the GUI Builder, you should be first familiar with the key NetBeans concepts which are explained in the NetBeans IDE Java Quick Start Tutorial.This lesson guides you through the process of creating a bean pattern in the NetBeans projects, introduces the user interface of the GUI Builder, and explains how to add your  bean object to the palette.
Creating a New Project
In the NetBeans IDE, you always work in a project where you store sources and files. Tocreate a new project, perform the following steps:1.Select New Project from the File menu. You can also click the New Project button in the IDE toolbar.2.In the Categories pane, select the General node. In the Projects pane, choose theJava Application type. Click the Next button.3.Enter MyBean in the Project Name field and specify the project location. Do notcreate a
class here, because later you will create a new
class in this project.4.Click the Finish button.This figure represents the expanded MyBean node in the Projects list.

Activity (33)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Clyde Mkorombindo liked this
Negasi Abebe liked this
Savan Kharadi liked this
Vijaya Bhavana liked this
Amadou Bagayoko liked this
Vansh Aggarwal liked this
bhagwatsachin liked this
seravanakumar liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->