• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
01 Java Is Architecture Neutral
 

01 Java Is Architecture Neutral

on

  • 5,392 views

 

Statistics

Views

Total Views
5,392
Views on SlideShare
5,388
Embed Views
4

Actions

Likes
2
Downloads
77
Comments
3

2 Embeds 4

http://www.slideshare.net 3
http://www.health.medicbd.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

13 of 3 previous next Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    01 Java Is Architecture Neutral 01 Java Is Architecture Neutral Presentation Transcript

    • 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