SlideShare a Scribd company logo
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

introduction of Java beans
introduction of Java beansintroduction of Java beans
introduction of Java beans
shravan kumar upadhayay
 
Java beans
Java beansJava beans
Java beans
Mukesh Tekwani
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
Hitesh Parmar
 
Java Beans
Java BeansJava Beans
Java Beans
Ankit Desai
 
Java beans
Java beansJava beans
enterprise java bean
enterprise java beanenterprise java bean
enterprise java bean
Jitender Singh Lodhi
 
0012
00120012
0012none
 
Session bean
Session beanSession bean
Session bean
sandeep54552
 
Ejb3.1 for the starter
Ejb3.1 for the starterEjb3.1 for the starter
Ejb3.1 for the starter
shohancse
 
Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in java
Acp Jamod
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Rohit Kelapure
 
EJB 3.0 and J2EE
EJB 3.0 and J2EEEJB 3.0 and J2EE
EJB 3.0 and J2EE
Aniruddha Ray (Ani)
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
Emprovise
 
Spring framework
Spring frameworkSpring framework
Spring framework
Rajkumar Singh
 
Ejb notes
Ejb notesEjb notes
Ejb notes
Mumbai Academisc
 

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.pptxsofiathoma
 
Java Networking
Java NetworkingJava Networking
Java Networking
Ankit Desai
 
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 - Žrnovokorculanskaliga
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
Armen Arzumanyan
 

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

Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - Maven
Bert Koorengevel
 
Maven2交流
Maven2交流Maven2交流
Maven2交流
ChangQi Lin
 
Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?
Max Andersen
 
JSP Part 2
JSP Part 2JSP Part 2
JSP Part 2
DeeptiJava
 
Net Beans61 Platform
Net Beans61 PlatformNet Beans61 Platform
Net Beans61 Platform
satyajit_t
 
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
Steve Keener
 
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
Mohamed Rimzan
 
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
Russell Maher
 
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...
Sencha
 
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
SISTechnologies
 
Codename BEAN.pptx
Codename BEAN.pptxCodename BEAN.pptx
Codename BEAN.pptx
MusicArena1
 
The Virtual Repository
The Virtual RepositoryThe Virtual Repository
The Virtual Repository
Fabio Simeoni
 
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
michaelaaron25322
 
Monorepo: React Web & React Native
Monorepo: React Web & React NativeMonorepo: React Web & React Native
Monorepo: React Web & React Native
Eugene Zharkov
 
01 spring-intro
01 spring-intro01 spring-intro
01 spring-intro
hossein helali
 
1. react - native: setup
1. react - native: setup1. react - native: setup
1. react - native: setup
Govind Prasad Gupta
 
Apache Maven
Apache MavenApache Maven
Apache Maven
venkatraghavang
 
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
IBM Connections Developers
 
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
Ryan Baxter
 

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

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 

Recently uploaded (20)

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.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 ); } }