SlideShare a Scribd company logo
1 of 50
ADVANCE JAVA
ADVANCE JAVA
Author Profile
 Ankit Desai
 Ph.D. Scholar, IET, Ahmedabad University
 Education: M. Tech. (C.E.), B. E. (I. T.)
 Experience: 8 years (Academic and Research)
 Research Interest: IoT, Big Data Analytics, Machine
Learning, Data Mining, Algorithms.
Classified e-Material 2
Classified e-Material 3
Swing Features
PasswordStore shows some of the rich functionality
of a particular Swing application. This lesson
discusses the general features available to
applications using the Java SE platform and, in
particular, the Swing toolkit.
Classified e-Material 4
Index
 Swing Features
1. A Visual Guide to Swing Components (Java Look and
Feel)
2. A Visual Guide to Swing Components (Windows Look
and Feel)
3. Pluggable Look and Feel
4. Data Transfer
5. Internationalization and Localization
6. Accessibility
7. Integrating with the Desktop System Tray Icon
Support
Classified e-Material 5
Swing Features
 1. A Visual Guide to Swing Components (Java
Look and Feel)
 Swing is primarily known for its rich set of GUI
components. This section provides a visual menu of
Swing's components, grouped by type, using the
Java look and feel.
Classified e-Material 6
Swing Features
 2. A Visual Guide to Swing Components
(Windows Look and Feel)
 This section shows the same components, using the
Windows look and feel.
Classified e-Material 7
A Visual Guide to Swing Components
(Java Look and Feel v/s Windows Look
and Feel)
Classified e-Material 8
Basic Controls
 Simple components that are used primarily to get
input from the user;
they may also show simple state.
Classified e-Material 9
JAVA Look v/s Windows Look
JAVA Look Windows Look
JButton
JCheckBox
JComboBox
JList
Classified e-Material 10
JAVA Look v/s Windows Look
JAVA Look Windows Look
JMenu
JRadioButton
JSpinner
Classified e-Material 11
JAVA Look v/s Windows Look
JAVA Look Windows Look
JPasswordField
JSlider
JTextField
Classified e-Material 12
Interactive Displays of Highly Formatted Information
 These components display highly formatted
information that
(if you choose) can be modified by the user.
Classified e-Material 13
JAVA Look Windows Look
JColorChooser
JAVA Look v/s Windows Look
Classified e-Material 14
JAVA Look v/s Windows Look
JAVA Look Windows Look
JFileChooser
JTable
Classified e-Material 15
JAVA Look Windows Look
JTextArea
JEditorPane and
JTextPane
Classified e-Material 16
JAVA Look Windows Look
JTree
Classified e-Material 17
Uneditable Information Displays
 These components exist solely to give the user
information.
Classified e-Material 18
JAVA Look Windows Look
JSeparator
JProgressBar
JLabel
JToolTip
Classified e-Material 19
Top-Level Containers
 At least one of these components must be present
in any Swing application.
Classified e-Material 20
JAVA Look Windows Look
JFrame
JDialog
JApplet
Classified e-Material 21
General-Purpose Containers
 These general-purpose containers are used in most
Swing applications.
Classified e-Material 22
JAVA Look Windows Look
JSplitPane
JTabbedPane
Classified e-Material 23
JAVA Look Windows Look
JScrollPane
JPanel
JToolBar
Classified e-Material 24
Special-Purpose Containers
 These special-purpose containers play specific roles
in the UI.
Classified e-Material 25
JAVA Look Windows Look
JLayeredPanel
JInternalFrame
Classified e-Material 26
JAVA Look Windows Look
Root panel
Classified e-Material 27
Swing Features
 3. Pluggable Look and Feel
 The pluggable look and feel architecture allows a
program to have control over its appearance. This
section describes what options are available to the
programmer.
Classified e-Material 28
Pluggable Look and Feel
 The Swing toolkit allows you to decide how to
configure the particular look and feel of your
application. If you don't specify a look and feel, the
Swing UI manager figures out which one to use.
Classified e-Material 29
Java look and feel
Classified e-Material 30
Windows look and feel
Classified e-Material 31
CDE/Motif look and feel
Classified e-Material 32
Default Alloy look and feel
Classified e-Material 33
Synthetica look and feel
Classified e-Material 34
Swing Features
 4. Data Transfer
 Most programs will want to use drag and drop or cut,
copy and paste. This section talks a bit about data
transfer and what is implemented for you.
Classified e-Material 35
Drag and Drop
 Drag-and-drop support can be easily enabled for
many of Swing's components (sometimes with a
single line of code). For example, it's trivial to
enable drag and drop and copy and paste support
for JTable, Swing's table component. All you need
to provide is the data representing the selection
and how to get your data from the clipboard —
that's it!
Classified e-Material 36
Cut, Copy, and Paste
 Most of the text-based components, such as editor
pane and text field, support cut/copy and paste out
of the box. Of course, menu items need to be
created and "wired up" to the appropriate actions.
Other components, such as list and tree, can
support cut, copy, and paste with some minimal
work.
Classified e-Material 37
Swing Features
 5. Internationalization and Localization
 Internationalizing an application makes it easy to
tailor it to the customs and languages of end users
around the world. This section describes the
difference between internationalization and
localization.
Classified e-Material 38
Internationalization vs Localization
 Internationalization is the process of designing an
application so that the user can run it using his or
her cultural preferences without modifying or
recompiling the code.
 Localization is the process of translating the text to
a particular language and adding any locale-specific
components.
Classified e-Material 39
PasswordStore in Japanese PasswordStore in Arabic
Classified e-Material 40
Swing Features
 6. Accessibility
 Making your program accessible means that it can be
used, without modification, by anyone with
permanent or temporary disabilities who may require
special devices. And, in many countries, making
programs accessible is the law.
Classified e-Material 41
Accessibility
 The PasswordStore demo
follows the rules set out
for accessibility. In the
following figure, you can
see an example of tool
tip text.
PasswordStore With a Tooltip
Classified e-Material 42
Swing Features
 7. Integrating with the Desktop
 An application that is well integrated with the
desktop will, where appropriate, allow the user to
launch the default mail application or internet
browser, pre-populating text fields as needed. It will
also allow the user to launch another application to
open, edit or print a file associated with that
application.
Classified e-Material 43
Types
 Three types of integration are supported:
 Default browser with a specific Uniform Resource
Identifier (URI).
 Default email client.
 Applications to open, edit, or print files associated
with those applications.
Classified e-Material 44
Example
 Click on the link that is
displayed in the text
pane — it opens the
specified URI in the
default browser.
Click on the URI and it opens in the Default
Browser
Classified e-Material 45
Swing Features
 8. System Tray Icon Support
 Some platforms, such as Microsoft Windows, feature
a system tray on the desktop. As of version 6 of the
Java SE, your application can now add a tray icon to
the system tray.
Classified e-Material 46
Snap Shot
 The desktop of some platforms, such as Microsoft
Windows, includes a system tray, as shown in the
following screenshot:
Classified e-Material 47
Questions
 Questions and Exercises: Graphical User Interfaces
 1. Does Swing support multiple look and feels?
 2. True or False: The Java look and feel is the only
look and feel that works across all platforms.
 3. True or False: Swing's Undo Framework supports
an unlimited number of actions to undo (and redo).
 4. Can Swing's list component (JList) only display
text?
 5. Which Swing component provides undo support
out of the box?
 6. Can Java applications interact with the native
desktop? components.
 7. Can I deploy my Swing application on the web?
Classified e-Material 48
Answers to Questions and Exercises: Graphical User Interfaces
 1. Does Swing support multiple look and feels? Yes. Sun
provides implementations for the GTK+ look and feel,
Windows look and feel, CDE/Motif look and feel, Synth (a
customizable look and feel), and two variants of the Java
look and feel.
 2. True or False: The Java look and feel is the only look
and feel that works across all platforms.
 True. The Java look and feel (also called Metal) comes in
two themes. Previous to the 5.0 release, the theme was
called Steel. The theme for 5.0 and beyond, is called
Ocean.
Classified e-Material 49
 3. True or False: Swing's Undo Framework supports an
unlimited number of actions to undo (and redo).
 True. Undo support is built-in to Swing's text component
and can be added to other components.
 4. Can Swing's list component (JList) only display text?
 No, as the demo illustrated you can display anything you
want in a JList, including rich graphics.
 5. Which Swing component provides undo support out of
the box?
 Swing's text components.
Classified e-Material 50
 6. Can Java applications interact with the native
desktop? components.
 Certainly, the Desktop API allows you to open up the
browser and various other services and the TrayIcon API
allows you to put a Swing component into the desktop
tray.
 7. Can I deploy my Swing application on the web?
 Certainly. You can use either Java Web Start or Java
Plugin.

More Related Content

What's hot

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
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in javaAdil Mehmoood
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Javayht4ever
 
Java- GUI- Mazenet solution
Java- GUI- Mazenet solutionJava- GUI- Mazenet solution
Java- GUI- Mazenet solutionMazenetsolution
 
JAVA GUI PART I
JAVA GUI PART IJAVA GUI PART I
JAVA GUI PART IOXUS 20
 
Basic using of Swing in Java
Basic using of Swing in JavaBasic using of Swing in Java
Basic using of Swing in Javasuraj pandey
 
Complete java swing
Complete java swingComplete java swing
Complete java swingjehan1987
 

What's hot (20)

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
 
Java swing
Java swingJava swing
Java swing
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in java
 
Java swing
Java swingJava swing
Java swing
 
java2 swing
java2 swingjava2 swing
java2 swing
 
Java Swing
Java SwingJava Swing
Java Swing
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 
Java- GUI- Mazenet solution
Java- GUI- Mazenet solutionJava- GUI- Mazenet solution
Java- GUI- Mazenet solution
 
JAVA GUI PART I
JAVA GUI PART IJAVA GUI PART I
JAVA GUI PART I
 
GUI Programming with Java
GUI Programming with JavaGUI Programming with Java
GUI Programming with Java
 
GUI programming
GUI programmingGUI programming
GUI programming
 
Basic using of Swing in Java
Basic using of Swing in JavaBasic using of Swing in Java
Basic using of Swing in Java
 
Complete java swing
Complete java swingComplete java swing
Complete java swing
 
Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
 
Jdbc
JdbcJdbc
Jdbc
 
Swings in java
Swings in javaSwings in java
Swings in java
 
04b swing tutorial
04b swing tutorial04b swing tutorial
04b swing tutorial
 
Java swing and events
Java swing and eventsJava swing and events
Java swing and events
 
GUI components in Java
GUI components in JavaGUI components in Java
GUI components in Java
 

Similar to java swing programming

Java Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage EssayJava Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage EssayLiz Sims
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating guiViên Mai
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesSolstice Mobile Argentina
 
行動App開發管理實務 unit2
行動App開發管理實務 unit2行動App開發管理實務 unit2
行動App開發管理實務 unit2Xavier Yin
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System RequirementsLaura Arrigo
 
IRJET- Conversational Commerce (ESTILO)
IRJET- Conversational Commerce (ESTILO)IRJET- Conversational Commerce (ESTILO)
IRJET- Conversational Commerce (ESTILO)IRJET Journal
 
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...IRJET Journal
 
Workshop Android for Java Developers
Workshop Android for Java DevelopersWorkshop Android for Java Developers
Workshop Android for Java Developersmhant
 
Ext Js In Action January 2010 (Meap Edition)
Ext Js In Action January 2010 (Meap Edition)Ext Js In Action January 2010 (Meap Edition)
Ext Js In Action January 2010 (Meap Edition)Goran Kljajic
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swingbackdoor
 
Plug yourself in and your app will never be the same (2 hr editon)
Plug yourself in and your app will never be the same (2 hr editon)Plug yourself in and your app will never be the same (2 hr editon)
Plug yourself in and your app will never be the same (2 hr editon)Mikkel Flindt Heisterberg
 
Plug yourself in and your app will never be the same (2 hour edition)
Plug yourself in and your app will never be the same (2 hour edition)Plug yourself in and your app will never be the same (2 hour edition)
Plug yourself in and your app will never be the same (2 hour edition)Mikkel Flindt Heisterberg
 
Introduction
IntroductionIntroduction
Introductionrichsoden
 

Similar to java swing programming (20)

Chapter 1-Note.docx
Chapter 1-Note.docxChapter 1-Note.docx
Chapter 1-Note.docx
 
Java Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage EssayJava Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage Essay
 
Game Studio
Game StudioGame Studio
Game Studio
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating gui
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
Java swing 1
Java swing 1Java swing 1
Java swing 1
 
行動App開發管理實務 unit2
行動App開發管理實務 unit2行動App開發管理實務 unit2
行動App開發管理實務 unit2
 
Ex11 mini project
Ex11 mini projectEx11 mini project
Ex11 mini project
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System Requirements
 
IRJET- Conversational Commerce (ESTILO)
IRJET- Conversational Commerce (ESTILO)IRJET- Conversational Commerce (ESTILO)
IRJET- Conversational Commerce (ESTILO)
 
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
 
ID E's features
ID E's featuresID E's features
ID E's features
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
 
Workshop Android for Java Developers
Workshop Android for Java DevelopersWorkshop Android for Java Developers
Workshop Android for Java Developers
 
java slides
java slidesjava slides
java slides
 
Ext Js In Action January 2010 (Meap Edition)
Ext Js In Action January 2010 (Meap Edition)Ext Js In Action January 2010 (Meap Edition)
Ext Js In Action January 2010 (Meap Edition)
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
 
Plug yourself in and your app will never be the same (2 hr editon)
Plug yourself in and your app will never be the same (2 hr editon)Plug yourself in and your app will never be the same (2 hr editon)
Plug yourself in and your app will never be the same (2 hr editon)
 
Plug yourself in and your app will never be the same (2 hour edition)
Plug yourself in and your app will never be the same (2 hour edition)Plug yourself in and your app will never be the same (2 hour edition)
Plug yourself in and your app will never be the same (2 hour edition)
 
Introduction
IntroductionIntroduction
Introduction
 

More from Ankit Desai

java code and document security
java code and document securityjava code and document security
java code and document securityAnkit Desai
 
java drag and drop and data transfer
java drag and drop and data transferjava drag and drop and data transfer
java drag and drop and data transferAnkit Desai
 
Presentation14 audio play
Presentation14 audio playPresentation14 audio play
Presentation14 audio playAnkit Desai
 
Presentation15 parse xml
Presentation15 parse xmlPresentation15 parse xml
Presentation15 parse xmlAnkit Desai
 
Presentation11 sq lite
Presentation11 sq litePresentation11 sq lite
Presentation11 sq liteAnkit Desai
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installationAnkit Desai
 
Presentation10 view navigation
Presentation10 view navigationPresentation10 view navigation
Presentation10 view navigationAnkit Desai
 
Presentation7 segment control
Presentation7 segment controlPresentation7 segment control
Presentation7 segment controlAnkit Desai
 
Presentation6 ui image_view
Presentation6 ui image_viewPresentation6 ui image_view
Presentation6 ui image_viewAnkit Desai
 
Presentation5 picker view
Presentation5 picker viewPresentation5 picker view
Presentation5 picker viewAnkit Desai
 
Presentation4 date picker
Presentation4 date pickerPresentation4 date picker
Presentation4 date pickerAnkit Desai
 
Presentation3 actionsheet alertview
Presentation3 actionsheet alertviewPresentation3 actionsheet alertview
Presentation3 actionsheet alertviewAnkit Desai
 
Presentation1 password
Presentation1 passwordPresentation1 password
Presentation1 passwordAnkit Desai
 
Presentation2 gesture control
Presentation2 gesture controlPresentation2 gesture control
Presentation2 gesture controlAnkit Desai
 
Presentation8 silder switch_progress
Presentation8 silder switch_progressPresentation8 silder switch_progress
Presentation8 silder switch_progressAnkit Desai
 

More from Ankit Desai (20)

java Jdbc
java Jdbc java Jdbc
java Jdbc
 
java code and document security
java code and document securityjava code and document security
java code and document security
 
Java Beans
Java BeansJava Beans
Java Beans
 
java drag and drop and data transfer
java drag and drop and data transferjava drag and drop and data transfer
java drag and drop and data transfer
 
Java RMI
Java RMIJava RMI
Java RMI
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
JDBC
JDBCJDBC
JDBC
 
Presentation14 audio play
Presentation14 audio playPresentation14 audio play
Presentation14 audio play
 
Presentation15 parse xml
Presentation15 parse xmlPresentation15 parse xml
Presentation15 parse xml
 
Presentation11 sq lite
Presentation11 sq litePresentation11 sq lite
Presentation11 sq lite
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Presentation10 view navigation
Presentation10 view navigationPresentation10 view navigation
Presentation10 view navigation
 
Presentation7 segment control
Presentation7 segment controlPresentation7 segment control
Presentation7 segment control
 
Presentation6 ui image_view
Presentation6 ui image_viewPresentation6 ui image_view
Presentation6 ui image_view
 
Presentation5 picker view
Presentation5 picker viewPresentation5 picker view
Presentation5 picker view
 
Presentation4 date picker
Presentation4 date pickerPresentation4 date picker
Presentation4 date picker
 
Presentation3 actionsheet alertview
Presentation3 actionsheet alertviewPresentation3 actionsheet alertview
Presentation3 actionsheet alertview
 
Presentation1 password
Presentation1 passwordPresentation1 password
Presentation1 password
 
Presentation2 gesture control
Presentation2 gesture controlPresentation2 gesture control
Presentation2 gesture control
 
Presentation8 silder switch_progress
Presentation8 silder switch_progressPresentation8 silder switch_progress
Presentation8 silder switch_progress
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

java swing programming

  • 2. ADVANCE JAVA Author Profile  Ankit Desai  Ph.D. Scholar, IET, Ahmedabad University  Education: M. Tech. (C.E.), B. E. (I. T.)  Experience: 8 years (Academic and Research)  Research Interest: IoT, Big Data Analytics, Machine Learning, Data Mining, Algorithms. Classified e-Material 2
  • 3. Classified e-Material 3 Swing Features PasswordStore shows some of the rich functionality of a particular Swing application. This lesson discusses the general features available to applications using the Java SE platform and, in particular, the Swing toolkit.
  • 4. Classified e-Material 4 Index  Swing Features 1. A Visual Guide to Swing Components (Java Look and Feel) 2. A Visual Guide to Swing Components (Windows Look and Feel) 3. Pluggable Look and Feel 4. Data Transfer 5. Internationalization and Localization 6. Accessibility 7. Integrating with the Desktop System Tray Icon Support
  • 5. Classified e-Material 5 Swing Features  1. A Visual Guide to Swing Components (Java Look and Feel)  Swing is primarily known for its rich set of GUI components. This section provides a visual menu of Swing's components, grouped by type, using the Java look and feel.
  • 6. Classified e-Material 6 Swing Features  2. A Visual Guide to Swing Components (Windows Look and Feel)  This section shows the same components, using the Windows look and feel.
  • 7. Classified e-Material 7 A Visual Guide to Swing Components (Java Look and Feel v/s Windows Look and Feel)
  • 8. Classified e-Material 8 Basic Controls  Simple components that are used primarily to get input from the user; they may also show simple state.
  • 9. Classified e-Material 9 JAVA Look v/s Windows Look JAVA Look Windows Look JButton JCheckBox JComboBox JList
  • 10. Classified e-Material 10 JAVA Look v/s Windows Look JAVA Look Windows Look JMenu JRadioButton JSpinner
  • 11. Classified e-Material 11 JAVA Look v/s Windows Look JAVA Look Windows Look JPasswordField JSlider JTextField
  • 12. Classified e-Material 12 Interactive Displays of Highly Formatted Information  These components display highly formatted information that (if you choose) can be modified by the user.
  • 13. Classified e-Material 13 JAVA Look Windows Look JColorChooser JAVA Look v/s Windows Look
  • 14. Classified e-Material 14 JAVA Look v/s Windows Look JAVA Look Windows Look JFileChooser JTable
  • 15. Classified e-Material 15 JAVA Look Windows Look JTextArea JEditorPane and JTextPane
  • 16. Classified e-Material 16 JAVA Look Windows Look JTree
  • 17. Classified e-Material 17 Uneditable Information Displays  These components exist solely to give the user information.
  • 18. Classified e-Material 18 JAVA Look Windows Look JSeparator JProgressBar JLabel JToolTip
  • 19. Classified e-Material 19 Top-Level Containers  At least one of these components must be present in any Swing application.
  • 20. Classified e-Material 20 JAVA Look Windows Look JFrame JDialog JApplet
  • 21. Classified e-Material 21 General-Purpose Containers  These general-purpose containers are used in most Swing applications.
  • 22. Classified e-Material 22 JAVA Look Windows Look JSplitPane JTabbedPane
  • 23. Classified e-Material 23 JAVA Look Windows Look JScrollPane JPanel JToolBar
  • 24. Classified e-Material 24 Special-Purpose Containers  These special-purpose containers play specific roles in the UI.
  • 25. Classified e-Material 25 JAVA Look Windows Look JLayeredPanel JInternalFrame
  • 26. Classified e-Material 26 JAVA Look Windows Look Root panel
  • 27. Classified e-Material 27 Swing Features  3. Pluggable Look and Feel  The pluggable look and feel architecture allows a program to have control over its appearance. This section describes what options are available to the programmer.
  • 28. Classified e-Material 28 Pluggable Look and Feel  The Swing toolkit allows you to decide how to configure the particular look and feel of your application. If you don't specify a look and feel, the Swing UI manager figures out which one to use.
  • 32. Classified e-Material 32 Default Alloy look and feel
  • 34. Classified e-Material 34 Swing Features  4. Data Transfer  Most programs will want to use drag and drop or cut, copy and paste. This section talks a bit about data transfer and what is implemented for you.
  • 35. Classified e-Material 35 Drag and Drop  Drag-and-drop support can be easily enabled for many of Swing's components (sometimes with a single line of code). For example, it's trivial to enable drag and drop and copy and paste support for JTable, Swing's table component. All you need to provide is the data representing the selection and how to get your data from the clipboard — that's it!
  • 36. Classified e-Material 36 Cut, Copy, and Paste  Most of the text-based components, such as editor pane and text field, support cut/copy and paste out of the box. Of course, menu items need to be created and "wired up" to the appropriate actions. Other components, such as list and tree, can support cut, copy, and paste with some minimal work.
  • 37. Classified e-Material 37 Swing Features  5. Internationalization and Localization  Internationalizing an application makes it easy to tailor it to the customs and languages of end users around the world. This section describes the difference between internationalization and localization.
  • 38. Classified e-Material 38 Internationalization vs Localization  Internationalization is the process of designing an application so that the user can run it using his or her cultural preferences without modifying or recompiling the code.  Localization is the process of translating the text to a particular language and adding any locale-specific components.
  • 39. Classified e-Material 39 PasswordStore in Japanese PasswordStore in Arabic
  • 40. Classified e-Material 40 Swing Features  6. Accessibility  Making your program accessible means that it can be used, without modification, by anyone with permanent or temporary disabilities who may require special devices. And, in many countries, making programs accessible is the law.
  • 41. Classified e-Material 41 Accessibility  The PasswordStore demo follows the rules set out for accessibility. In the following figure, you can see an example of tool tip text. PasswordStore With a Tooltip
  • 42. Classified e-Material 42 Swing Features  7. Integrating with the Desktop  An application that is well integrated with the desktop will, where appropriate, allow the user to launch the default mail application or internet browser, pre-populating text fields as needed. It will also allow the user to launch another application to open, edit or print a file associated with that application.
  • 43. Classified e-Material 43 Types  Three types of integration are supported:  Default browser with a specific Uniform Resource Identifier (URI).  Default email client.  Applications to open, edit, or print files associated with those applications.
  • 44. Classified e-Material 44 Example  Click on the link that is displayed in the text pane — it opens the specified URI in the default browser. Click on the URI and it opens in the Default Browser
  • 45. Classified e-Material 45 Swing Features  8. System Tray Icon Support  Some platforms, such as Microsoft Windows, feature a system tray on the desktop. As of version 6 of the Java SE, your application can now add a tray icon to the system tray.
  • 46. Classified e-Material 46 Snap Shot  The desktop of some platforms, such as Microsoft Windows, includes a system tray, as shown in the following screenshot:
  • 47. Classified e-Material 47 Questions  Questions and Exercises: Graphical User Interfaces  1. Does Swing support multiple look and feels?  2. True or False: The Java look and feel is the only look and feel that works across all platforms.  3. True or False: Swing's Undo Framework supports an unlimited number of actions to undo (and redo).  4. Can Swing's list component (JList) only display text?  5. Which Swing component provides undo support out of the box?  6. Can Java applications interact with the native desktop? components.  7. Can I deploy my Swing application on the web?
  • 48. Classified e-Material 48 Answers to Questions and Exercises: Graphical User Interfaces  1. Does Swing support multiple look and feels? Yes. Sun provides implementations for the GTK+ look and feel, Windows look and feel, CDE/Motif look and feel, Synth (a customizable look and feel), and two variants of the Java look and feel.  2. True or False: The Java look and feel is the only look and feel that works across all platforms.  True. The Java look and feel (also called Metal) comes in two themes. Previous to the 5.0 release, the theme was called Steel. The theme for 5.0 and beyond, is called Ocean.
  • 49. Classified e-Material 49  3. True or False: Swing's Undo Framework supports an unlimited number of actions to undo (and redo).  True. Undo support is built-in to Swing's text component and can be added to other components.  4. Can Swing's list component (JList) only display text?  No, as the demo illustrated you can display anything you want in a JList, including rich graphics.  5. Which Swing component provides undo support out of the box?  Swing's text components.
  • 50. Classified e-Material 50  6. Can Java applications interact with the native desktop? components.  Certainly, the Desktop API allows you to open up the browser and various other services and the TrayIcon API allows you to put a Swing component into the desktop tray.  7. Can I deploy my Swing application on the web?  Certainly. You can use either Java Web Start or Java Plugin.