SlideShare a Scribd company logo
Architecture Dependent /* My first C program. */ #include <stdio.h> Main() { Printf(“Hello World!”); } Platform  independent  C source code C compiler for Sun Solaris C compiler for Windows C compiler for Mac OS C compiler for  Linux Compilation Yields 10010110011101101001010101001010 10110101011001010111010101111101 01010100101010101011101010001001 10101011110011101000101001011100 Platform specific binary code
Java Architecture Neutral // My first Java program.  public class HelloWorld { public static void main (String[ ] args) { System.out.println(“Hello World!”);  } } Platform  independent  java source code Compilation Yields E po 3/4 -     () V  ([Ljava/lang/String;)V <init> Code HelloWorld HelloWorld.java…………. Platform independent byte code A platform DEPENDENT JVM running on the underlying Hardware  architecture 101010010100100101001010010010100011010001010010001000001001010001010010 Binary code java compiler for Sun Solaris java compiler for  Windows Java compiler for  Mac OS Java compiler for  Linux
Hierarchical diagram Dimension Font FontMetrics Color Graphics Component LayoutManager Container Panel Window Applet Frame Dialog JApplet JFrame JDialog JComponent 1 ** Classes in the  java.awt package  Swing Components in the  javax.swing package  HeavyWeight  LightWeight
JComponent and its subclasses AbstractButton JTextComponent JMenuItem JButton JToggleButton JEditorPane JTextField JTextArea JCheckBoxMenuItem Jmenu JRadioButtonMenuItem JCheckBox JRadioButton JPasswordField JLabel JList JComboBox JMenuBar JPanel JOptionPane JScrollBar JScrollPane JFileChooser JPopupMenu JProgressBar JInternalFrame JSeparator JToolbar JToolTip JSlider JSplitPane JLayeredPane JTabbedPane JTable JTableHeader JRootPane JTree JPane JColorChooser JComponent
EventObject Class AWTEvent ListSelectionEvent ActionEvent AdjustmentEvent ComponentEvent ItemEvent TextEvent ContainerEvent FocusEvent InputEvent PaintEvent WindowEvent EventObject MouseEvent KeyEvent
Event Registration, Listening and Handling Register a Listener object Source Object Event Object Event Handler Listener Object Trigger an Event Generate an Event Generate an Event An event triggered by user actions on the source objects. The source object generates the event object and invokes the handler of the listener object to process the event. User action
Graphical user interface: Application Frame Pull-down Menus A frame can contain menus, panels, and user interface components. Panels can contain other panels. Panel Panel Panel UI Panel UI Panel UI Panel UI User Interface Components (UI)
Graphical user interface: Applet Applet Pull-down Menus A frame can contain menus, panels, and user interface components. Panels can contain other panels. Panel Panel User Interface Component Panel User Interface Component Panel Panel Panel User Interface Component Panel Panel User Interface Component Panel User Interface Component Panel Panel User Interface Component Panel Panel
UserAction, SourceObject and EventType MouseEvent Component Mouse pressed, released, moved, clicked, entered, or exited KeyEvent Component Key released or pressed ListSelectionEvent JList Select Item(s) AdjustmentEvent JScrollBar Move the scroll bar WindowEvent Window Window open, close,closing, iconified,de-iconified ContainerEvent Container Component added/removed ComponentEvent Component Component moved, resized, hidden or shown  TextEvent JTextComponent Change text FocusEvent Component Component gained or lost focus ItemEvent, ActionEvent JRadioButton Click a radio button ItemEvent, ActionEvent JCheckBox Click a check box ItemEvent, ActionEvent JComboBox Select a new item ActionEvent JMenuItem Select menu item ActionEvent JTextField <cr> on a text field ActionEvent JButton Click a button Event Type generated Source Object User Action
Events, EventListener and Listener Methods componentMoved(ComponentEvent e) componentHidden(ComponentEvent e) componentResized(ComponentEvent e) componentShown(ComponentEvent e) ComponentListener ComponentEvent componentAdded(ContainerEvent e) componentRemoved(ContainerEvent e) ContainerListener ContainerEvent focusGained(FocusEvent e) focusLost(FocusEvent e) FocusListener FocusEvent keyPressed(KeyEvent e) keyReleased(KeyEvent e) keyTyped(KeyEvent e) KeyListener KeyEvent adjustmentValueChanged (AdjustmentEvent e) AdjustmentListener AdjustmentEvent textValueChanged(TextEvent e) TextListener TextEvent itemStateChanged(ItemEvent e) ItemListener ItemEvent ActionPerformed(ActionEvent e) ActionListener ActionEvent Listener Methods (handlers) Listener Interface Event Class
Events, EventListener and Listener Methods windowClosing(WindowEvent e) windowOpened(WindowEvent e) windowIconfied(WindowEvent e) windowDeIconified(WindowEvent e) windowClosed(WindowEvent e) windowActivated(WindowEvent e) windowDeactivated(WindowEvent e) WindowListener WindowEvent mousePressed(MouseEvent e) mouseReleased(MouseEvent e) mouseEntered (MouseEvent e) mouseExited (MouseEvent e) mouseClicked (MouseEvent e) mouseDragged (MouseEvent e) mouseMoved (MouseEvent e) MouseListener MouseMotionListener MouseEvent Listener Methods (handlers) Listener Interface Event Class

More Related Content

Viewers also liked (6)

PPT
Windows Programming with AWT
backdoor
 
PPTX
High Performance Data Analytics with Java on Large Multicore HPC Clusters
Saliya Ekanayake
 
PPTX
Java event processing model in c# and java
Tech_MX
 
PDF
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
AboutYouGmbH
 
PPTX
Introduction to JAVA
javatrainingonline
 
PPSX
Core java lessons
vivek shah
 
Windows Programming with AWT
backdoor
 
High Performance Data Analytics with Java on Large Multicore HPC Clusters
Saliya Ekanayake
 
Java event processing model in c# and java
Tech_MX
 
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
AboutYouGmbH
 
Introduction to JAVA
javatrainingonline
 
Core java lessons
vivek shah
 

Similar to 01 Java Is Architecture Neutral (20)

PDF
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
Jyothishmathi Institute of Technology and Science Karimnagar
 
PPTX
EventHandling in object oriented programming
Parameshwar Maddela
 
PPT
Gu iintro(java)
Satish Verma
 
PPTX
Java AWT and Java FX
pratikkadam78
 
PDF
Ajp notes-chapter-03
Ankit Dubey
 
PPTX
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
PPT
Chapter 8 event Handling.ppt m m m m m m
zmulani8
 
PPT
Chapter 5 GUI for introduction of java and gui .ppt
HabibMuhammed2
 
PPT
Unit 6 Java
arnold 7490
 
PPT
engineeringdsgtnotesofunitfivesnists.ppt
sharanyak0721
 
PDF
Java Foundation Classes - Building Portable GUIs
Arun Seetharaman
 
PPTX
File Handling
Sohanur63
 
PPTX
tL20 event handling
teach4uin
 
PDF
Gui
Sardar Alam
 
PPT
event handling new.ppt
usama537223
 
PPTX
SWING USING JAVA WITH VARIOUS COMPONENTS
bharathiv53
 
PPTX
Event Handling in java
Google
 
PPTX
JAVA UNIT 5.pptx jejsjdkkdkdkjjndjfjfkfjfnfn
KGowtham16
 
PDF
Swing
Nataraj Dg
 
PPTX
event-handling.pptx
usvirat1805
 
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
Jyothishmathi Institute of Technology and Science Karimnagar
 
EventHandling in object oriented programming
Parameshwar Maddela
 
Gu iintro(java)
Satish Verma
 
Java AWT and Java FX
pratikkadam78
 
Ajp notes-chapter-03
Ankit Dubey
 
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
Chapter 8 event Handling.ppt m m m m m m
zmulani8
 
Chapter 5 GUI for introduction of java and gui .ppt
HabibMuhammed2
 
Unit 6 Java
arnold 7490
 
engineeringdsgtnotesofunitfivesnists.ppt
sharanyak0721
 
Java Foundation Classes - Building Portable GUIs
Arun Seetharaman
 
File Handling
Sohanur63
 
tL20 event handling
teach4uin
 
event handling new.ppt
usama537223
 
SWING USING JAVA WITH VARIOUS COMPONENTS
bharathiv53
 
Event Handling in java
Google
 
JAVA UNIT 5.pptx jejsjdkkdkdkjjndjfjfkfjfnfn
KGowtham16
 
Swing
Nataraj Dg
 
event-handling.pptx
usvirat1805
 
Ad

Recently uploaded (20)

PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Ad

01 Java Is Architecture Neutral

  • 1. Architecture Dependent /* My first C program. */ #include <stdio.h> Main() { Printf(“Hello World!”); } Platform independent C source code C compiler for Sun Solaris C compiler for Windows C compiler for Mac OS C compiler for Linux Compilation Yields 10010110011101101001010101001010 10110101011001010111010101111101 01010100101010101011101010001001 10101011110011101000101001011100 Platform specific binary code
  • 2. Java Architecture Neutral // My first Java program. public class HelloWorld { public static void main (String[ ] args) { System.out.println(“Hello World!”); } } Platform independent java source code Compilation Yields E po 3/4 -   () V  ([Ljava/lang/String;)V <init> Code HelloWorld HelloWorld.java…………. Platform independent byte code A platform DEPENDENT JVM running on the underlying Hardware architecture 101010010100100101001010010010100011010001010010001000001001010001010010 Binary code java compiler for Sun Solaris java compiler for Windows Java compiler for Mac OS Java compiler for Linux
  • 3. Hierarchical diagram Dimension Font FontMetrics Color Graphics Component LayoutManager Container Panel Window Applet Frame Dialog JApplet JFrame JDialog JComponent 1 ** Classes in the java.awt package Swing Components in the javax.swing package HeavyWeight LightWeight
  • 4. JComponent and its subclasses AbstractButton JTextComponent JMenuItem JButton JToggleButton JEditorPane JTextField JTextArea JCheckBoxMenuItem Jmenu JRadioButtonMenuItem JCheckBox JRadioButton JPasswordField JLabel JList JComboBox JMenuBar JPanel JOptionPane JScrollBar JScrollPane JFileChooser JPopupMenu JProgressBar JInternalFrame JSeparator JToolbar JToolTip JSlider JSplitPane JLayeredPane JTabbedPane JTable JTableHeader JRootPane JTree JPane JColorChooser JComponent
  • 5. EventObject Class AWTEvent ListSelectionEvent ActionEvent AdjustmentEvent ComponentEvent ItemEvent TextEvent ContainerEvent FocusEvent InputEvent PaintEvent WindowEvent EventObject MouseEvent KeyEvent
  • 6. Event Registration, Listening and Handling Register a Listener object Source Object Event Object Event Handler Listener Object Trigger an Event Generate an Event Generate an Event An event triggered by user actions on the source objects. The source object generates the event object and invokes the handler of the listener object to process the event. User action
  • 7. Graphical user interface: Application Frame Pull-down Menus A frame can contain menus, panels, and user interface components. Panels can contain other panels. Panel Panel Panel UI Panel UI Panel UI Panel UI User Interface Components (UI)
  • 8. Graphical user interface: Applet Applet Pull-down Menus A frame can contain menus, panels, and user interface components. Panels can contain other panels. Panel Panel User Interface Component Panel User Interface Component Panel Panel Panel User Interface Component Panel Panel User Interface Component Panel User Interface Component Panel Panel User Interface Component Panel Panel
  • 9. UserAction, SourceObject and EventType MouseEvent Component Mouse pressed, released, moved, clicked, entered, or exited KeyEvent Component Key released or pressed ListSelectionEvent JList Select Item(s) AdjustmentEvent JScrollBar Move the scroll bar WindowEvent Window Window open, close,closing, iconified,de-iconified ContainerEvent Container Component added/removed ComponentEvent Component Component moved, resized, hidden or shown TextEvent JTextComponent Change text FocusEvent Component Component gained or lost focus ItemEvent, ActionEvent JRadioButton Click a radio button ItemEvent, ActionEvent JCheckBox Click a check box ItemEvent, ActionEvent JComboBox Select a new item ActionEvent JMenuItem Select menu item ActionEvent JTextField <cr> on a text field ActionEvent JButton Click a button Event Type generated Source Object User Action
  • 10. Events, EventListener and Listener Methods componentMoved(ComponentEvent e) componentHidden(ComponentEvent e) componentResized(ComponentEvent e) componentShown(ComponentEvent e) ComponentListener ComponentEvent componentAdded(ContainerEvent e) componentRemoved(ContainerEvent e) ContainerListener ContainerEvent focusGained(FocusEvent e) focusLost(FocusEvent e) FocusListener FocusEvent keyPressed(KeyEvent e) keyReleased(KeyEvent e) keyTyped(KeyEvent e) KeyListener KeyEvent adjustmentValueChanged (AdjustmentEvent e) AdjustmentListener AdjustmentEvent textValueChanged(TextEvent e) TextListener TextEvent itemStateChanged(ItemEvent e) ItemListener ItemEvent ActionPerformed(ActionEvent e) ActionListener ActionEvent Listener Methods (handlers) Listener Interface Event Class
  • 11. Events, EventListener and Listener Methods windowClosing(WindowEvent e) windowOpened(WindowEvent e) windowIconfied(WindowEvent e) windowDeIconified(WindowEvent e) windowClosed(WindowEvent e) windowActivated(WindowEvent e) windowDeactivated(WindowEvent e) WindowListener WindowEvent mousePressed(MouseEvent e) mouseReleased(MouseEvent e) mouseEntered (MouseEvent e) mouseExited (MouseEvent e) mouseClicked (MouseEvent e) mouseDragged (MouseEvent e) mouseMoved (MouseEvent e) MouseListener MouseMotionListener MouseEvent Listener Methods (handlers) Listener Interface Event Class