SlideShare a Scribd company logo
1 of 3
F a i s a l a b a d
1 1 / 2 1 / 2 0 1 3
F. Ansari
This document contain the summary of
JOptionPane class
Javadocx
Javadocx
JOptionPane class
JOptionPane is a class in which mostly 4 kinds of dialog boxes can be displayed. A
dialog box is a small graphical window that displays a message to the user or input as
requested by user. There are following types of method used to display dialog boxes.
Method Name Description
showConfirmDialog Asks a confirming question, like yes/no/cancel.
showInputDialog Prompt for some input.
showMessageDialog Tell the user about something that has happened.
showOptionDialog The Grand Unification of the above three.
This class is not available to our java programs but we have to import it by writing
“import javax.swing.JOptionPane;” we use “import javax.swing.JOptionPane;” before
the programs class definition. It tells the compiler where to find the JOptionPane class. It
provides static methods to display each type of dialog box. Dot operator is used to
access the methods of dialog boxes that is JOptionPane.showMessageDialog method is
used to display a message dialog, JOptionPane.showMessageDialog (null, "Hello
World");. The second argument is the message that is to be displayed on the dialog box.
The input dialog box is used to ask the user to enter data. The dialog displays a text field,
an Ok button and a Cancel button. If Ok is pressed, the dialog returns the user’s input. If
Cancel is pressed, the dialog returns null. A program that uses JOptionPane does not
automatically stop executing when the end of the main method is reached. If the
System.exit(0); method is not called, the thread main() continues to execute. The
System.exit(0); method requires an integer argument that is 0. This argument is an exit
code that is passed back to the operating system. This code is usually ignored however it
can be used outside of the program.
For example:
import javax.swing.JOptionPane;
public class NamesDialog
{
public static void main(String[] args)
{
String firstName; // The user's first name
firstName = JOptionPane.showInputDialog("What is " + "your first name? ");
// Get the user's first name
JOptionPane.showMessageDialog(null, "Hello " + firstName + " " +middleName + " " +
lastName); //displays the user’s first name
System.exit(0);
}
}

More Related Content

What's hot

Exception Handling in C#
Exception Handling in C#Exception Handling in C#
Exception Handling in C#Abid Kohistani
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A ReviewFernando Torres
 
Dr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDrRajeshreeKhande
 
Object Oriended Programming with Java
Object Oriended Programming with JavaObject Oriended Programming with Java
Object Oriended Programming with JavaJakir Hossain
 
Basic using of Swing in Java
Basic using of Swing in JavaBasic using of Swing in Java
Basic using of Swing in Javasuraj pandey
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introductionHock Leng PUAH
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Elizabeth alexander
 
Java- GUI- Mazenet solution
Java- GUI- Mazenet solutionJava- GUI- Mazenet solution
Java- GUI- Mazenet solutionMazenetsolution
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Javasuraj pandey
 
Graphical User Interface in JAVA
Graphical User Interface in JAVAGraphical User Interface in JAVA
Graphical User Interface in JAVAsuraj pandey
 

What's hot (20)

Exception Handling in C#
Exception Handling in C#Exception Handling in C#
Exception Handling in C#
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A Review
 
GUI programming
GUI programmingGUI programming
GUI programming
 
Dr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWT
 
Object Oriended Programming with Java
Object Oriended Programming with JavaObject Oriended Programming with Java
Object Oriended Programming with Java
 
Java script basic
Java script basicJava script basic
Java script basic
 
Java swing
Java swingJava swing
Java swing
 
Basic using of Swing in Java
Basic using of Swing in JavaBasic using of Swing in Java
Basic using of Swing in Java
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
Built in exceptions
Built in exceptions Built in exceptions
Built in exceptions
 
java swing
java swingjava swing
java swing
 
Java swing
Java swingJava swing
Java swing
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introduction
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
 
Java- GUI- Mazenet solution
Java- GUI- Mazenet solutionJava- GUI- Mazenet solution
Java- GUI- Mazenet solution
 
Chapter 1 swings
Chapter 1 swingsChapter 1 swings
Chapter 1 swings
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Java
 
Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
 
Graphical User Interface in JAVA
Graphical User Interface in JAVAGraphical User Interface in JAVA
Graphical User Interface in JAVA
 
Java swing and events
Java swing and eventsJava swing and events
Java swing and events
 

Viewers also liked

Summary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
Summary of Simultaneous Multithreading: Maximizing On-Chip ParallelismSummary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
Summary of Simultaneous Multithreading: Maximizing On-Chip ParallelismFarwa Ansari
 
Digital logic and design's Lab 3
Digital logic and design's Lab 3Digital logic and design's Lab 3
Digital logic and design's Lab 3Farwa Ansari
 
Linear combination of vector
Linear combination of vectorLinear combination of vector
Linear combination of vectorFarwa Ansari
 
Applications of Image Processing
Applications of Image ProcessingApplications of Image Processing
Applications of Image ProcessingFarwa Ansari
 
Raster images (assignment)
Raster images (assignment)Raster images (assignment)
Raster images (assignment)Farwa Ansari
 
Digital logic and design's Lab 4 nand
Digital logic and design's Lab 4 nandDigital logic and design's Lab 4 nand
Digital logic and design's Lab 4 nandFarwa Ansari
 
Prefix and suffix of open gl
Prefix and suffix of open glPrefix and suffix of open gl
Prefix and suffix of open glFarwa Ansari
 
Cohen sutherland algorithm
Cohen sutherland algorithmCohen sutherland algorithm
Cohen sutherland algorithmFarwa Ansari
 
JAVA Manual remaining
JAVA Manual remainingJAVA Manual remaining
JAVA Manual remainingFarwa Ansari
 
Manual of JAVA (more than Half)
Manual of JAVA (more than Half)Manual of JAVA (more than Half)
Manual of JAVA (more than Half)Farwa Ansari
 
Tomasulo Algorithm
Tomasulo AlgorithmTomasulo Algorithm
Tomasulo AlgorithmFarwa Ansari
 
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)Farwa Ansari
 
Mission statement and Vision statement of 3 Different Companies
Mission statement and Vision statement of 3 Different CompaniesMission statement and Vision statement of 3 Different Companies
Mission statement and Vision statement of 3 Different CompaniesFarwa Ansari
 
IPv6 Implementation challenges
IPv6 Implementation challengesIPv6 Implementation challenges
IPv6 Implementation challengesFarwa Ansari
 
Implementation & Challenges of IPv6
Implementation & Challenges of IPv6Implementation & Challenges of IPv6
Implementation & Challenges of IPv6 Farwa Ansari
 
DLDLab 8 half adder
DLDLab 8 half adderDLDLab 8 half adder
DLDLab 8 half adderFarwa Ansari
 
Graphic display devices
Graphic display devicesGraphic display devices
Graphic display devicesFarwa Ansari
 
Memory Hierarchy Design, Basics, Cache Optimization, Address Translation
Memory Hierarchy Design, Basics, Cache Optimization, Address TranslationMemory Hierarchy Design, Basics, Cache Optimization, Address Translation
Memory Hierarchy Design, Basics, Cache Optimization, Address TranslationFarwa Ansari
 

Viewers also liked (20)

Summary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
Summary of Simultaneous Multithreading: Maximizing On-Chip ParallelismSummary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
Summary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
 
Digital logic and design's Lab 3
Digital logic and design's Lab 3Digital logic and design's Lab 3
Digital logic and design's Lab 3
 
Linear combination of vector
Linear combination of vectorLinear combination of vector
Linear combination of vector
 
Applications of Image Processing
Applications of Image ProcessingApplications of Image Processing
Applications of Image Processing
 
Raster images (assignment)
Raster images (assignment)Raster images (assignment)
Raster images (assignment)
 
Digital logic and design's Lab 4 nand
Digital logic and design's Lab 4 nandDigital logic and design's Lab 4 nand
Digital logic and design's Lab 4 nand
 
Prefix and suffix of open gl
Prefix and suffix of open glPrefix and suffix of open gl
Prefix and suffix of open gl
 
Cohen sutherland algorithm
Cohen sutherland algorithmCohen sutherland algorithm
Cohen sutherland algorithm
 
Scaling
ScalingScaling
Scaling
 
JAVA Manual remaining
JAVA Manual remainingJAVA Manual remaining
JAVA Manual remaining
 
Manual of JAVA (more than Half)
Manual of JAVA (more than Half)Manual of JAVA (more than Half)
Manual of JAVA (more than Half)
 
Templates
TemplatesTemplates
Templates
 
Tomasulo Algorithm
Tomasulo AlgorithmTomasulo Algorithm
Tomasulo Algorithm
 
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
 
Mission statement and Vision statement of 3 Different Companies
Mission statement and Vision statement of 3 Different CompaniesMission statement and Vision statement of 3 Different Companies
Mission statement and Vision statement of 3 Different Companies
 
IPv6 Implementation challenges
IPv6 Implementation challengesIPv6 Implementation challenges
IPv6 Implementation challenges
 
Implementation & Challenges of IPv6
Implementation & Challenges of IPv6Implementation & Challenges of IPv6
Implementation & Challenges of IPv6
 
DLDLab 8 half adder
DLDLab 8 half adderDLDLab 8 half adder
DLDLab 8 half adder
 
Graphic display devices
Graphic display devicesGraphic display devices
Graphic display devices
 
Memory Hierarchy Design, Basics, Cache Optimization, Address Translation
Memory Hierarchy Design, Basics, Cache Optimization, Address TranslationMemory Hierarchy Design, Basics, Cache Optimization, Address Translation
Memory Hierarchy Design, Basics, Cache Optimization, Address Translation
 

Similar to Javadocx j option pane

Android basics – dialogs and floating activities
Android basics – dialogs and floating activitiesAndroid basics – dialogs and floating activities
Android basics – dialogs and floating activitiesinfo_zybotech
 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4sotlsoc
 
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxModule Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxroushhsiu
 
XMetaL Dialog Odds & Ends
XMetaL Dialog Odds & EndsXMetaL Dialog Odds & Ends
XMetaL Dialog Odds & EndsXMetaL
 
Java căn bản - Chapter8
Java căn bản - Chapter8Java căn bản - Chapter8
Java căn bản - Chapter8Vince Vo
 
Chapter 8 - Exceptions and Assertions Edit summary
Chapter 8 - Exceptions and Assertions  Edit summaryChapter 8 - Exceptions and Assertions  Edit summary
Chapter 8 - Exceptions and Assertions Edit summaryEduardo Bergavera
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docxpaynetawnya
 
Complete java swing
Complete java swingComplete java swing
Complete java swingjehan1987
 
Gui builder
Gui builderGui builder
Gui builderlearnt
 
Eo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5eEo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5eGina Bullock
 
Eo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5eEo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5eGina Bullock
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...yazad dumasia
 
Presentation on design pattern software project lll
 Presentation on design pattern  software project lll  Presentation on design pattern  software project lll
Presentation on design pattern software project lll Uchiha Shahin
 
Session2-J2ME development-environment
Session2-J2ME development-environmentSession2-J2ME development-environment
Session2-J2ME development-environmentmuthusvm
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2Ruth Marvin
 
OOFeatures_revised-2.pptx
OOFeatures_revised-2.pptxOOFeatures_revised-2.pptx
OOFeatures_revised-2.pptxssuser84e52e
 

Similar to Javadocx j option pane (20)

Android basics – dialogs and floating activities
Android basics – dialogs and floating activitiesAndroid basics – dialogs and floating activities
Android basics – dialogs and floating activities
 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4
 
java intro.pptx.pdf
java intro.pptx.pdfjava intro.pptx.pdf
java intro.pptx.pdf
 
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxModule Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
 
Lo3
Lo3Lo3
Lo3
 
XMetaL Dialog Odds & Ends
XMetaL Dialog Odds & EndsXMetaL Dialog Odds & Ends
XMetaL Dialog Odds & Ends
 
Java căn bản - Chapter8
Java căn bản - Chapter8Java căn bản - Chapter8
Java căn bản - Chapter8
 
Chapter 8 - Exceptions and Assertions Edit summary
Chapter 8 - Exceptions and Assertions  Edit summaryChapter 8 - Exceptions and Assertions  Edit summary
Chapter 8 - Exceptions and Assertions Edit summary
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
 
Complete java swing
Complete java swingComplete java swing
Complete java swing
 
Gui builder
Gui builderGui builder
Gui builder
 
Eo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5eEo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5e
 
Eo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5eEo gaddis java_chapter_11_5e
Eo gaddis java_chapter_11_5e
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
 
Presentation on design pattern software project lll
 Presentation on design pattern  software project lll  Presentation on design pattern  software project lll
Presentation on design pattern software project lll
 
Session2-J2ME development-environment
Session2-J2ME development-environmentSession2-J2ME development-environment
Session2-J2ME development-environment
 
Ingles 2do parcial
Ingles   2do parcialIngles   2do parcial
Ingles 2do parcial
 
Advance JFACE
Advance JFACEAdvance JFACE
Advance JFACE
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2
 
OOFeatures_revised-2.pptx
OOFeatures_revised-2.pptxOOFeatures_revised-2.pptx
OOFeatures_revised-2.pptx
 

More from Farwa Ansari

Energy Harvesting Techniques in Wireless Sensor Networks – A Survey
Energy Harvesting Techniques in Wireless Sensor Networks – A SurveyEnergy Harvesting Techniques in Wireless Sensor Networks – A Survey
Energy Harvesting Techniques in Wireless Sensor Networks – A SurveyFarwa Ansari
 
Micro-services architecture
Micro-services architectureMicro-services architecture
Micro-services architectureFarwa Ansari
 
Software Design Patterns - An Overview
Software Design Patterns - An OverviewSoftware Design Patterns - An Overview
Software Design Patterns - An OverviewFarwa Ansari
 
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...Farwa Ansari
 
Fault Tolerance Typed Assembly Language - A graphical overview
Fault Tolerance Typed Assembly Language - A graphical overviewFault Tolerance Typed Assembly Language - A graphical overview
Fault Tolerance Typed Assembly Language - A graphical overviewFarwa Ansari
 
Comparative Analysis of Face Recognition Methodologies and Techniques
Comparative Analysis of Face Recognition Methodologies and TechniquesComparative Analysis of Face Recognition Methodologies and Techniques
Comparative Analysis of Face Recognition Methodologies and TechniquesFarwa Ansari
 
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)Farwa Ansari
 
Business plan of a software house
Business plan of a software houseBusiness plan of a software house
Business plan of a software houseFarwa Ansari
 
Hacking and Hackers
Hacking and HackersHacking and Hackers
Hacking and HackersFarwa Ansari
 

More from Farwa Ansari (10)

Energy Harvesting Techniques in Wireless Sensor Networks – A Survey
Energy Harvesting Techniques in Wireless Sensor Networks – A SurveyEnergy Harvesting Techniques in Wireless Sensor Networks – A Survey
Energy Harvesting Techniques in Wireless Sensor Networks – A Survey
 
Micro-services architecture
Micro-services architectureMicro-services architecture
Micro-services architecture
 
Software Design Patterns - An Overview
Software Design Patterns - An OverviewSoftware Design Patterns - An Overview
Software Design Patterns - An Overview
 
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
 
Fault Tolerance Typed Assembly Language - A graphical overview
Fault Tolerance Typed Assembly Language - A graphical overviewFault Tolerance Typed Assembly Language - A graphical overview
Fault Tolerance Typed Assembly Language - A graphical overview
 
Comparative Analysis of Face Recognition Methodologies and Techniques
Comparative Analysis of Face Recognition Methodologies and TechniquesComparative Analysis of Face Recognition Methodologies and Techniques
Comparative Analysis of Face Recognition Methodologies and Techniques
 
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
 
Business plan of a software house
Business plan of a software houseBusiness plan of a software house
Business plan of a software house
 
Dld (lab 1 & 2)
Dld (lab 1 & 2)Dld (lab 1 & 2)
Dld (lab 1 & 2)
 
Hacking and Hackers
Hacking and HackersHacking and Hackers
Hacking and Hackers
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 

Javadocx j option pane

  • 1. F a i s a l a b a d 1 1 / 2 1 / 2 0 1 3 F. Ansari This document contain the summary of JOptionPane class Javadocx
  • 2. Javadocx JOptionPane class JOptionPane is a class in which mostly 4 kinds of dialog boxes can be displayed. A dialog box is a small graphical window that displays a message to the user or input as requested by user. There are following types of method used to display dialog boxes. Method Name Description showConfirmDialog Asks a confirming question, like yes/no/cancel. showInputDialog Prompt for some input. showMessageDialog Tell the user about something that has happened. showOptionDialog The Grand Unification of the above three. This class is not available to our java programs but we have to import it by writing “import javax.swing.JOptionPane;” we use “import javax.swing.JOptionPane;” before the programs class definition. It tells the compiler where to find the JOptionPane class. It provides static methods to display each type of dialog box. Dot operator is used to access the methods of dialog boxes that is JOptionPane.showMessageDialog method is used to display a message dialog, JOptionPane.showMessageDialog (null, "Hello World");. The second argument is the message that is to be displayed on the dialog box. The input dialog box is used to ask the user to enter data. The dialog displays a text field, an Ok button and a Cancel button. If Ok is pressed, the dialog returns the user’s input. If Cancel is pressed, the dialog returns null. A program that uses JOptionPane does not automatically stop executing when the end of the main method is reached. If the System.exit(0); method is not called, the thread main() continues to execute. The System.exit(0); method requires an integer argument that is 0. This argument is an exit code that is passed back to the operating system. This code is usually ignored however it can be used outside of the program. For example: import javax.swing.JOptionPane; public class NamesDialog { public static void main(String[] args) { String firstName; // The user's first name firstName = JOptionPane.showInputDialog("What is " + "your first name? "); // Get the user's first name JOptionPane.showMessageDialog(null, "Hello " + firstName + " " +middleName + " " + lastName); //displays the user’s first name