SlideShare a Scribd company logo
1 of 19
Internet Technologies- JavaBeans 
Java Beans
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
2 
Components 
• Hardware components of Integrated 
Circuits – Resistors, Capacitors and 
Inductors 
• All of these components can be reused in 
different type of circuits 
• Software components – buttons, 
textboxes, checkboxes, radio buttons 
• The above mentioned components can be 
used in the following applications: 
– Calculator 
– Railway reservation system 
– Online polling system etc.,
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
3 
Components Assembly 
• Assembly is one of the key features of Java Bean 
though no not specific solution is provided. 
– Different ways of assembling components are 
supplied. 
Component-based assembly Heterogeneous assembly
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
4 
What are beans? 
• Reusable Java code 
• Easiest to reuse is static objects; 
– Ex: Text fields, buttons 
– Available as third-party products 
– Limited interaction with environment 
– The functionality does not change 
• Can be composed into complex beans 
• Drag-and-drop using application 
construction tools
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
5 
What is a Java Bean? 
• A component technology for Java that 
allows a developer to create reusable 
software objects. 
• A Java Bean is a reusable software 
component that can be visually 
manipulated in builder tools( during the 
software development). 
• A Java Bean is a software component that 
has been designed to be reusable in a 
variety of different environments.
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
6 
Advantages of Java Beans 
• Obtains all the benefits of Java (write-once, run-anywhere) 
• The properties, events and methods of a bean 
that are exposed to an application builder tool can 
be controlled 
• A Bean may be designed to operate correctly in 
different locales 
• Auxiliary software can be provided to help a 
person configure a Bean 
• The configuration settings of a Bean can be saved 
in persistent storage and restored at a later time 
• A Bean may register to receive events from other 
objects and can generate events that are sent to 
other objects
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
7 
Application Builder Tools 
• A utility that enables the user to configure 
a set of Beans, connect them together, 
and produce a working application 
– A palette is provided that lists all of the 
available Beans 
– A worksheet is displayed that allows the 
designer to lay out Beans in a GUI. A designer 
may drag and drop a Bean from the palette to 
this worksheet 
– Special editors and customizers allow a Bean 
to be configured 
– Commands allow a designer to inquire about 
the state and behavior of a Bean 
– Capabilities exist to interconnect beans
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
8 
Design Patterns for Properties 
A property is a subset of a Bean’s state 
• Simple properties 
• Boolean properties 
• Indexed properties
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
9 
Simple and Boolean properties 
// member used to store property value // 
private String internalString; 
// set and get method for property named String // 
public void setString(String newValue) 
{ internalString = newValue; } 
public String getString() 
{ return internalString; } 
// member used to store property value // 
private boolean connect; 
// set and get method for boolean property name connected // 
public void setConnected(boolean newValue) 
{ connect = newValue; } 
public boolean isConnected(} { return connect; }
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
10 
Indexed properties 
• An indexed property represent a 
array of values. And we can use 
additional get and set methods for an 
indexed property. This get and set 
method take an integer index 
parameter. This index parameter 
indicates the place in the array where 
the new property value has to be put.
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
11 
Indexed properties 
// member to store indexed property // 
private int[] numbers = {1, 2, 3, 4}; 
// set and get method for complete array // 
public void setNumbers(int[] newValue) 
{ 
numbers = newValue; 
} 
public int[] getNumbers() 
{ 
return numbers; 
}
Internet Technologies- JavaBeans 
Indexed properties 
Tuesday, November 18, 2014 
12 
// set and get method with index to set one element 
of array // 
public void setNumbers(int index, int newValue) 
{ 
numbers[index] = newValue; 
} 
public int getNumbers(int index) 
{ 
return numbers[index]; 
}
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
13 
Bean Class 
A bean is a Java class that: 
– Has a void constructor 
– Has private instance variables with setter and getter 
– Methods 
public class SimpleBean 
{ 
private int counter; 
SimpleBean() {counter=0;} 
int getCounter() {return counter;} 
void setCounter(int c) {counter=c;} 
}
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
14
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
15 
Steps involved in Creating a Java Bean 
a. Write the SimpleBean code. 
b. Create a manifest, the JAR file, and the class 
file SimpleBean.class. 
c. Load the JAR file (using NetBeans) 
– Start NetBeans. 
– From the File menu select "New Project" to create a new 
application for your bean. You can use "Open Project" to 
add your bean to an existing application. 
– Create a new application using the New Project Wizard. 
– Select a newly created project in the List of Projects, 
expand the Source Packages node, and select the 
Default Package element. 
– Click the right mouse button and select New|JFrameForm 
from the pop-up menu. 
– Select the newly created Form node in the Project Tree. 
A blank form opens in the GUI Builder view of an Editor 
tab.
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
16 
Steps involved in Creating a Java Bean 
continued 
– Open the Palette Manager for Swing/AWT 
components by selecting Palette Manager in the Tools 
menu. 
– In the Palette Manager window select the beans 
components in the Palette tree and press the "Add 
from JAR" button. 
– Specify a location for your SimpleBean JAR file and 
follow the Add from JAR Wizard instructions. 
– Select the Palette and Properties options from the 
Windows menu. 
– Expand the beans group in the Palette window. The 
SimpleBean object appears. Drag the SimpleBean 
object to the GUI Builder panel. 
d. Inspect Properties and Events
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
17 
JAR Files 
– A JAR file allows to efficiently deploy a 
set of classes and their associated 
resources 
– Elements in a JAR file are compressed 
– Digital signatures may also be 
associated with the individual elements 
in a JAR file
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
18 
Manifest Files 
– To indicate which of the components in a JAR 
file are Java Beans 
– Example 
• d:/demo/one.gif 
• d:/demo/two.gif 
• d:/demo/three.gif 
• d:/demo/one.class 
Java- Bean:True 
– A manifest file may reference several .class 
files. If a .class file is a Java Bean, its entry 
must be immediately followed by the line 
“Java- Bean:True”.
Internet Technologies- JavaBeans 
Tuesday, November 18, 2014 
19 
Deployed Bean 
import java.awt.Color; 
import javax.swing.JLabel; 
import java.io.Serializable; 
public class SimpleBean extends JLabel 
implements Serializable { 
public SimpleBean() { 
setText( "Hello world!" ); 
setOpaque( true ); 
setBackground( Color.BLUE ); 
setForeground( Color.YELLOW ); 
} 
}

More Related Content

What's hot

0012
00120012
0012
none
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010
Rohit Kelapure
 

What's hot (20)

introduction of Java beans
introduction of Java beansintroduction of Java beans
introduction of Java beans
 
Javabean1
Javabean1Javabean1
Javabean1
 
Java beans
Java beansJava beans
Java beans
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
Bean Intro
Bean IntroBean Intro
Bean Intro
 
Java Beans
Java BeansJava Beans
Java Beans
 
Unit4wt
Unit4wtUnit4wt
Unit4wt
 
Java beans
Java beansJava beans
Java beans
 
enterprise java bean
enterprise java beanenterprise java bean
enterprise java bean
 
0012
00120012
0012
 
Session bean
Session beanSession bean
Session bean
 
Ejb3.1 for the starter
Ejb3.1 for the starterEjb3.1 for the starter
Ejb3.1 for the starter
 
Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in java
 
Ejb3 Presentation
Ejb3 PresentationEjb3 Presentation
Ejb3 Presentation
 
EJB .
EJB .EJB .
EJB .
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010
 
EJB 3.0 and J2EE
EJB 3.0 and J2EEEJB 3.0 and J2EE
EJB 3.0 and J2EE
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Ejb notes
Ejb notesEjb notes
Ejb notes
 

Viewers also liked

Santa Ana School.pptx
Santa Ana School.pptxSanta Ana School.pptx
Santa Ana School.pptx
sofiathoma
 
EJB 3.1 by Bert Ertman
EJB 3.1 by Bert ErtmanEJB 3.1 by Bert Ertman
EJB 3.1 by Bert Ertman
Stephan Janssen
 
Korčulanska Liga - Žrnovo
Korčulanska Liga - ŽrnovoKorčulanska Liga - Žrnovo
Korčulanska Liga - Žrnovo
korculanskaliga
 

Viewers also liked (7)

Santa Ana School.pptx
Santa Ana School.pptxSanta Ana School.pptx
Santa Ana School.pptx
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
EJB 3.1 by Bert Ertman
EJB 3.1 by Bert ErtmanEJB 3.1 by Bert Ertman
EJB 3.1 by Bert Ertman
 
Java beans
Java beansJava beans
Java beans
 
Java bean
Java beanJava bean
Java bean
 
Korčulanska Liga - Žrnovo
Korčulanska Liga - ŽrnovoKorčulanska Liga - Žrnovo
Korčulanska Liga - Žrnovo
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
 

Similar to Beans presentation

Similar to Beans presentation (20)

Unit4wt
Unit4wtUnit4wt
Unit4wt
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - Maven
 
Maven2交流
Maven2交流Maven2交流
Maven2交流
 
Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?
 
JSP Part 2
JSP Part 2JSP Part 2
JSP Part 2
 
Net Beans61 Platform
Net Beans61 PlatformNet Beans61 Platform
Net Beans61 Platform
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
Android intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comAndroid intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.com
 
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowJMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOps
 
Codename BEAN.pptx
Codename BEAN.pptxCodename BEAN.pptx
Codename BEAN.pptx
 
The Virtual Repository
The Virtual RepositoryThe Virtual Repository
The Virtual Repository
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
Monorepo: React Web & React Native
Monorepo: React Web & React NativeMonorepo: React Web & React Native
Monorepo: React Web & React Native
 
01 spring-intro
01 spring-intro01 spring-intro
01 spring-intro
 
1. react - native: setup
1. react - native: setup1. react - native: setup
1. react - native: setup
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocialIBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
 
JMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocialJMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocial
 

Recently uploaded

會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 

Recently uploaded (20)

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 

Beans presentation

  • 2. Internet Technologies- JavaBeans Tuesday, November 18, 2014 2 Components • Hardware components of Integrated Circuits – Resistors, Capacitors and Inductors • All of these components can be reused in different type of circuits • Software components – buttons, textboxes, checkboxes, radio buttons • The above mentioned components can be used in the following applications: – Calculator – Railway reservation system – Online polling system etc.,
  • 3. Internet Technologies- JavaBeans Tuesday, November 18, 2014 3 Components Assembly • Assembly is one of the key features of Java Bean though no not specific solution is provided. – Different ways of assembling components are supplied. Component-based assembly Heterogeneous assembly
  • 4. Internet Technologies- JavaBeans Tuesday, November 18, 2014 4 What are beans? • Reusable Java code • Easiest to reuse is static objects; – Ex: Text fields, buttons – Available as third-party products – Limited interaction with environment – The functionality does not change • Can be composed into complex beans • Drag-and-drop using application construction tools
  • 5. Internet Technologies- JavaBeans Tuesday, November 18, 2014 5 What is a Java Bean? • A component technology for Java that allows a developer to create reusable software objects. • A Java Bean is a reusable software component that can be visually manipulated in builder tools( during the software development). • A Java Bean is a software component that has been designed to be reusable in a variety of different environments.
  • 6. Internet Technologies- JavaBeans Tuesday, November 18, 2014 6 Advantages of Java Beans • Obtains all the benefits of Java (write-once, run-anywhere) • The properties, events and methods of a bean that are exposed to an application builder tool can be controlled • A Bean may be designed to operate correctly in different locales • Auxiliary software can be provided to help a person configure a Bean • The configuration settings of a Bean can be saved in persistent storage and restored at a later time • A Bean may register to receive events from other objects and can generate events that are sent to other objects
  • 7. Internet Technologies- JavaBeans Tuesday, November 18, 2014 7 Application Builder Tools • A utility that enables the user to configure a set of Beans, connect them together, and produce a working application – A palette is provided that lists all of the available Beans – A worksheet is displayed that allows the designer to lay out Beans in a GUI. A designer may drag and drop a Bean from the palette to this worksheet – Special editors and customizers allow a Bean to be configured – Commands allow a designer to inquire about the state and behavior of a Bean – Capabilities exist to interconnect beans
  • 8. Internet Technologies- JavaBeans Tuesday, November 18, 2014 8 Design Patterns for Properties A property is a subset of a Bean’s state • Simple properties • Boolean properties • Indexed properties
  • 9. Internet Technologies- JavaBeans Tuesday, November 18, 2014 9 Simple and Boolean properties // member used to store property value // private String internalString; // set and get method for property named String // public void setString(String newValue) { internalString = newValue; } public String getString() { return internalString; } // member used to store property value // private boolean connect; // set and get method for boolean property name connected // public void setConnected(boolean newValue) { connect = newValue; } public boolean isConnected(} { return connect; }
  • 10. Internet Technologies- JavaBeans Tuesday, November 18, 2014 10 Indexed properties • An indexed property represent a array of values. And we can use additional get and set methods for an indexed property. This get and set method take an integer index parameter. This index parameter indicates the place in the array where the new property value has to be put.
  • 11. Internet Technologies- JavaBeans Tuesday, November 18, 2014 11 Indexed properties // member to store indexed property // private int[] numbers = {1, 2, 3, 4}; // set and get method for complete array // public void setNumbers(int[] newValue) { numbers = newValue; } public int[] getNumbers() { return numbers; }
  • 12. Internet Technologies- JavaBeans Indexed properties Tuesday, November 18, 2014 12 // set and get method with index to set one element of array // public void setNumbers(int index, int newValue) { numbers[index] = newValue; } public int getNumbers(int index) { return numbers[index]; }
  • 13. Internet Technologies- JavaBeans Tuesday, November 18, 2014 13 Bean Class A bean is a Java class that: – Has a void constructor – Has private instance variables with setter and getter – Methods public class SimpleBean { private int counter; SimpleBean() {counter=0;} int getCounter() {return counter;} void setCounter(int c) {counter=c;} }
  • 14. Internet Technologies- JavaBeans Tuesday, November 18, 2014 14
  • 15. Internet Technologies- JavaBeans Tuesday, November 18, 2014 15 Steps involved in Creating a Java Bean a. Write the SimpleBean code. b. Create a manifest, the JAR file, and the class file SimpleBean.class. c. Load the JAR file (using NetBeans) – Start NetBeans. – From the File menu select "New Project" to create a new application for your bean. You can use "Open Project" to add your bean to an existing application. – Create a new application using the New Project Wizard. – Select a newly created project in the List of Projects, expand the Source Packages node, and select the Default Package element. – Click the right mouse button and select New|JFrameForm from the pop-up menu. – Select the newly created Form node in the Project Tree. A blank form opens in the GUI Builder view of an Editor tab.
  • 16. Internet Technologies- JavaBeans Tuesday, November 18, 2014 16 Steps involved in Creating a Java Bean continued – Open the Palette Manager for Swing/AWT components by selecting Palette Manager in the Tools menu. – In the Palette Manager window select the beans components in the Palette tree and press the "Add from JAR" button. – Specify a location for your SimpleBean JAR file and follow the Add from JAR Wizard instructions. – Select the Palette and Properties options from the Windows menu. – Expand the beans group in the Palette window. The SimpleBean object appears. Drag the SimpleBean object to the GUI Builder panel. d. Inspect Properties and Events
  • 17. Internet Technologies- JavaBeans Tuesday, November 18, 2014 17 JAR Files – A JAR file allows to efficiently deploy a set of classes and their associated resources – Elements in a JAR file are compressed – Digital signatures may also be associated with the individual elements in a JAR file
  • 18. Internet Technologies- JavaBeans Tuesday, November 18, 2014 18 Manifest Files – To indicate which of the components in a JAR file are Java Beans – Example • d:/demo/one.gif • d:/demo/two.gif • d:/demo/three.gif • d:/demo/one.class Java- Bean:True – A manifest file may reference several .class files. If a .class file is a Java Bean, its entry must be immediately followed by the line “Java- Bean:True”.
  • 19. Internet Technologies- JavaBeans Tuesday, November 18, 2014 19 Deployed Bean import java.awt.Color; import javax.swing.JLabel; import java.io.Serializable; public class SimpleBean extends JLabel implements Serializable { public SimpleBean() { setText( "Hello world!" ); setOpaque( true ); setBackground( Color.BLUE ); setForeground( Color.YELLOW ); } }