SlideShare a Scribd company logo
6
Most read
14
Most read
15
Most read
Prepared by :- Hitesh Parmar
hitesh.parmar915@gmail.com
@i_hiteshparmar
 What is a Java Bean.
 Components and classes with respect to Java Bean.
 Java.Beans(Package).
 The Component and its type in Java Beans.
 Useful Terms while Using Java Beans.
 Software Components
 Visually Manipulated, Builder Tools
 Support
 “It’s a Component Architecture of Java which allow
you to define the Component ”
 Java Bean is nothing but the Java Class.
 Example:-
 Swing are all the Java Bean component
 Component (Button,TextField,Label)
 Java Bean classes follow certain Rule or Condition.
 All java Bean classes must Implement the Serializable
Interface.
 Component may be used by some apllication
builder.
 A bean has a no argument constructor.
Serializing
CLASS
Class Object
Component
Object
 Java Bean API makes it possible to write the
component s/w in a java programming language.
 This package will be used depending upon the need
of the Application (based on funcion of bean classes).
 Now when its only the use of the property or the
Getter & Setter Method at that time you might not
even make a use of this package.
 The component is nothing but the group of classes.
 Example:- Jbutton(it’s a component not a class).
 In order to a swing Button there are whole lot of class
are involved to build this Jbutton.
 Component is a single Functionality provided by
many different classes
 Component is a group of classses that interact with
eachother to fulfill the single purpose.
 Application developer uses different beans in his
application using the Java Beans.
 You can build two types of Components.
Component
GUI based
Non GUI based
Extends
Component
 Properties
 Event
 Persistence
 Introspection
 Customization
 Discrete, named attributes that determine the
appearance ,behavior and state of a component.
 Accessible programmatically through accessor
methods.
 Accessible visually through property sheets.
 Simple Properties
 Boolean Properties
 Indexed Properties
 1 Simple Properties:-
 Represent a single value.
 The accessor methods should follow standard naming
conventions.
public <PropertyType> get<PropertyName>();
public void set<PropertyName>(<PropertyType> value);
Example:
public String getHostName();
public void setHostName( String hostName );
 2 BooleanProperties:-
 They are simple properties
 The getter methods follow an optional design pattern
public boolean is<PropertyName>();
Example:
public boolean isConnected();
 3 Indexed Properties:-
 Represent an array of values
public <PropertyElement> get<PropertyName>(int index);
public void set<PropertyName>(int index,<PropertyElement> value);
public <PropertyElement>[] get<PropertyName>();
public void set<PropertyName>(<PropertyElement>[] values);
Example:
public Color setPalette(int index);
public void setPalette(int index,Color value);
public Color[] getPalette();
public void setPalette(Color[] values);
 Bound:-
 a bound property notifies other objects when its value
changes
 generates a PropertyChange event with property name,
old value and new value
 Constrained:-
 an object with constrained properties allows other
objects to veto a constrained property value change
 Constrained property listeners can veto a change by
throwing a PropertyVetoException
 Two types of objects are involved:
 “Source” objects.
 “Listener” objects.
 Message sent from one object to another.
 Sender fires event, recipient (listener) handles the
event
 There may be many listeners.
Event
source
Event
listener
Fire event
Event
Object
Register listener
Sender fires event, recipient (listener) handles
the event
 Persistance
 Your Bean should be able to store its state, which means
there should be the serializable interface.
 Upon the Bean a builder tool should be able to make a
reflaction and be able to create an object of your
component.
 [Ex. Drag and drop a component in to a design area and
the builder tool should be able to create the instance of
that component and be able to display the property of
that bean via reflaction.]
 Customization
 Using the Bean customization, you can specify what
methods or the properties that you want to expose at rhe
run time environment, so such property will be
displayed in the propertysheet.
 Introspection
 Is nothing but a reflection using which the builder tool
can display all the events and the properties of the
component.
 Reflection API
 It helps us to find out what are the contents of the class,
so you can findout what are the methods, constructors
and variables in the class and you can find out the
details in return.
 Due to the process of the reflection builder tool can be
able to display what are the property of the Component
in the property sheet and also provides the details
regarding the Events and methods.
 Buttons
 Text Fields
 List Boxes
 Scroll Bars
 Dialogs
BeanBoxToolBoxToolBox BeanBox
Property Sheet
 BDK - Sun
 NetBeans – www.netbeans.org
 Jbuilder - Inprise
 Super Mojo - Penumbra Software
 Visual Age for Java - IBM
 Visual Cafe - Symantec Corporation
 JDeveloper Suite - Oracle
Introduction to java beans

More Related Content

PPTX
Java Beans
PPT
Servlet life cycle
PPTX
Event In JavaScript
PPTX
JDBC ppt
PPTX
Servlets
PPS
Introduction to class in java
PPTX
Advance Java Topics (J2EE)
PDF
Threads concept in java
Java Beans
Servlet life cycle
Event In JavaScript
JDBC ppt
Servlets
Introduction to class in java
Advance Java Topics (J2EE)
Threads concept in java

What's hot (20)

PDF
07 java collection
PPSX
JDBC: java DataBase connectivity
PDF
Java Design Patterns Tutorial | Edureka
PPT
Jdbc ppt
PPT
Java layoutmanager
PPTX
Java Server Pages(jsp)
PDF
JavaScript - Chapter 12 - Document Object Model
PPTX
Ado.Net Tutorial
PPT
Java awt
PPTX
Event handling
PPTX
Java abstract class & abstract methods
PPT
Core java concepts
PPT
JSP Processing
PPT
Java beans
PPSX
Java annotations
PPS
Java Exception handling
PDF
JavaScript - Chapter 11 - Events
PPTX
Database architecture
PPTX
JAVA AWT
PDF
Collections In Java
07 java collection
JDBC: java DataBase connectivity
Java Design Patterns Tutorial | Edureka
Jdbc ppt
Java layoutmanager
Java Server Pages(jsp)
JavaScript - Chapter 12 - Document Object Model
Ado.Net Tutorial
Java awt
Event handling
Java abstract class & abstract methods
Core java concepts
JSP Processing
Java beans
Java annotations
Java Exception handling
JavaScript - Chapter 11 - Events
Database architecture
JAVA AWT
Collections In Java
Ad

Similar to Introduction to java beans (20)

PPT
Java beans
PDF
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
PPT
Java beans
PPTX
Unit4wt
PPTX
Unit4wt
PPTX
Java beans
PPT
introduction of Java beans
PPTX
Javabeans
PPT
Bean Intro
PPTX
Java Beans Unit 4(part 2)
PPTX
Unit iv
PPTX
Java Beans Unit 4(Part 1)
PPT
Javabean1
PDF
Javabeans .pdf
PPT
CommercialSystemsBahman.ppt
PPTX
Codename BEAN.pptx
PDF
javabeans
PPT
Beans presentation
PPT
web programmimg- concpt in JAVABEANS.ppt
Java beans
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
Java beans
Unit4wt
Unit4wt
Java beans
introduction of Java beans
Javabeans
Bean Intro
Java Beans Unit 4(part 2)
Unit iv
Java Beans Unit 4(Part 1)
Javabean1
Javabeans .pdf
CommercialSystemsBahman.ppt
Codename BEAN.pptx
javabeans
Beans presentation
web programmimg- concpt in JAVABEANS.ppt
Ad

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
System and Network Administraation Chapter 3
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Introduction to Artificial Intelligence
PDF
Nekopoi APK 2025 free lastest update
PDF
AI in Product Development-omnex systems
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Understanding Forklifts - TECH EHS Solution
PDF
System and Network Administration Chapter 2
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Online Work Permit System for Fast Permit Processing
medical staffing services at VALiNTRY
Internet Downloader Manager (IDM) Crack 6.42 Build 41
System and Network Administraation Chapter 3
Which alternative to Crystal Reports is best for small or large businesses.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Introduction to Artificial Intelligence
Nekopoi APK 2025 free lastest update
AI in Product Development-omnex systems
Softaken Excel to vCard Converter Software.pdf
CHAPTER 2 - PM Management and IT Context
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Odoo Companies in India – Driving Business Transformation.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PTS Company Brochure 2025 (1).pdf.......
Understanding Forklifts - TECH EHS Solution
System and Network Administration Chapter 2
ISO 45001 Occupational Health and Safety Management System
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Online Work Permit System for Fast Permit Processing

Introduction to java beans

  • 1. Prepared by :- Hitesh Parmar hitesh.parmar915@gmail.com @i_hiteshparmar
  • 2.  What is a Java Bean.  Components and classes with respect to Java Bean.  Java.Beans(Package).  The Component and its type in Java Beans.  Useful Terms while Using Java Beans.  Software Components  Visually Manipulated, Builder Tools  Support
  • 3.  “It’s a Component Architecture of Java which allow you to define the Component ”  Java Bean is nothing but the Java Class.  Example:-  Swing are all the Java Bean component  Component (Button,TextField,Label)
  • 4.  Java Bean classes follow certain Rule or Condition.  All java Bean classes must Implement the Serializable Interface.  Component may be used by some apllication builder.  A bean has a no argument constructor. Serializing CLASS Class Object Component Object
  • 5.  Java Bean API makes it possible to write the component s/w in a java programming language.  This package will be used depending upon the need of the Application (based on funcion of bean classes).  Now when its only the use of the property or the Getter & Setter Method at that time you might not even make a use of this package.
  • 6.  The component is nothing but the group of classes.  Example:- Jbutton(it’s a component not a class).  In order to a swing Button there are whole lot of class are involved to build this Jbutton.  Component is a single Functionality provided by many different classes  Component is a group of classses that interact with eachother to fulfill the single purpose.
  • 7.  Application developer uses different beans in his application using the Java Beans.  You can build two types of Components. Component GUI based Non GUI based Extends Component
  • 8.  Properties  Event  Persistence  Introspection  Customization
  • 9.  Discrete, named attributes that determine the appearance ,behavior and state of a component.  Accessible programmatically through accessor methods.  Accessible visually through property sheets.
  • 10.  Simple Properties  Boolean Properties  Indexed Properties
  • 11.  1 Simple Properties:-  Represent a single value.  The accessor methods should follow standard naming conventions. public <PropertyType> get<PropertyName>(); public void set<PropertyName>(<PropertyType> value); Example: public String getHostName(); public void setHostName( String hostName );
  • 12.  2 BooleanProperties:-  They are simple properties  The getter methods follow an optional design pattern public boolean is<PropertyName>(); Example: public boolean isConnected();
  • 13.  3 Indexed Properties:-  Represent an array of values public <PropertyElement> get<PropertyName>(int index); public void set<PropertyName>(int index,<PropertyElement> value); public <PropertyElement>[] get<PropertyName>(); public void set<PropertyName>(<PropertyElement>[] values); Example: public Color setPalette(int index); public void setPalette(int index,Color value); public Color[] getPalette(); public void setPalette(Color[] values);
  • 14.  Bound:-  a bound property notifies other objects when its value changes  generates a PropertyChange event with property name, old value and new value  Constrained:-  an object with constrained properties allows other objects to veto a constrained property value change  Constrained property listeners can veto a change by throwing a PropertyVetoException
  • 15.  Two types of objects are involved:  “Source” objects.  “Listener” objects.  Message sent from one object to another.  Sender fires event, recipient (listener) handles the event  There may be many listeners.
  • 16. Event source Event listener Fire event Event Object Register listener Sender fires event, recipient (listener) handles the event
  • 17.  Persistance  Your Bean should be able to store its state, which means there should be the serializable interface.  Upon the Bean a builder tool should be able to make a reflaction and be able to create an object of your component.  [Ex. Drag and drop a component in to a design area and the builder tool should be able to create the instance of that component and be able to display the property of that bean via reflaction.]
  • 18.  Customization  Using the Bean customization, you can specify what methods or the properties that you want to expose at rhe run time environment, so such property will be displayed in the propertysheet.  Introspection  Is nothing but a reflection using which the builder tool can display all the events and the properties of the component.
  • 19.  Reflection API  It helps us to find out what are the contents of the class, so you can findout what are the methods, constructors and variables in the class and you can find out the details in return.  Due to the process of the reflection builder tool can be able to display what are the property of the Component in the property sheet and also provides the details regarding the Events and methods.
  • 20.  Buttons  Text Fields  List Boxes  Scroll Bars  Dialogs
  • 22.  BDK - Sun  NetBeans – www.netbeans.org  Jbuilder - Inprise  Super Mojo - Penumbra Software  Visual Age for Java - IBM  Visual Cafe - Symantec Corporation  JDeveloper Suite - Oracle