Презентация Internet and Java Foundations, Programming and Practice онлайн

На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Internet and Java Foundations, Programming and Practice абсолютно бесплатно. Урок-презентация на эту тему содержит всего 205 слайдов. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » Internet and Java Foundations, Programming and Practice



Оцените!
Оцените презентацию от 1 до 5 баллов!
  • Тип файла:
    ppt / pptx (powerpoint)
  • Всего слайдов:
    205 слайдов
  • Для класса:
    1,2,3,4,5,6,7,8,9,10,11
  • Размер файла:
    969.50 kB
  • Просмотров:
    125
  • Скачиваний:
    0
  • Автор:
    неизвестен



Слайды и текст к этой презентации:

№1 слайд
Internet and Java
Содержание слайда: Internet and Java Foundations, Programming and Practice

№2 слайд
Agenda Internet and its
Содержание слайда: Agenda Internet and its Evolution Internet Tools Web and its Programming Java for Internet Programming Java Nuts and Bolts Java Platform Developing Applets and Applications Challenges and Future Directions

№3 слайд
What is the Internet ?
Содержание слайда: What is the Internet ?

№4 слайд
Internet Technology Evolution
Содержание слайда: Internet Technology Evolution Internet is much bigger than what we think More than 25 years old More than doubling every year Technology effect suddenly every body sees the need for a technology like the radio or the TV 10 terabytes flows everyday

№5 слайд
Internet Use of internet
Содержание слайда: Internet Use of internet advertisement/elections/newspapers information is public Ubiquitous technology Network is the computer Intranets - internal TCP/IP nets PC accounts for 55% of total IT Applications tied to platform - API lock-in

№6 слайд
Internet Evolution
Содержание слайда: Internet Evolution

№7 слайд
Early Internet Early Internet
Содержание слайда: Early Internet Early Internet supported only email . File Transfer Protocol development - ftp sites. Network News was added to the Internet. Archie - A program to canvass anonymous ftp sites and create a database of what is available Gopher- A menu-driven interface used to search for information. Archie and Gopher could answer questions only like ‘what FTP server contains info about “xxxx” ‘

№8 слайд
World Wide Web World Wide Web
Содержание слайда: World Wide Web World Wide Web conceptualized by Tim Berners-Lee at CERN in Switzerland Concept of Hypertext led to the development of the Hypertext Markup Language (HTML) Tim Berners-Lee proposed the ‘Browser’ program Scientists at CERN designed a TCP/IP based protocol to share Hypertext information called HTTP. WWW officially is described as a” Wide-area hypermedia information retrieval initiative aiming to give universal access to a large universe of documents.

№9 слайд
HTML Hypertext -A little Hype
Содержание слайда: HTML Hypertext -A little Hype and a Little Text. Hypertext point to information which can be local or remotely located. HTML -Derivative of the SGML( Standard Generalized Markup Language). HTML -information , commands for the Browser for formatting documents. HTML -The de-facto language for publishing on the Internet. Hypermedia- Hyper-links to Multimedia.

№10 слайд
Internet Tools Browsers- A
Содержание слайда: Internet Tools Browsers- A tool used to view documents on the WWW Web servers - Machines which run the HTTP-server Software that respond to HTTP requests which it receives Authoring Tools - Editors specially made for editing HTML documents Filters -Tools to convert legacy documents to HTML format Scripting -Languages used for scripting WAIS- Wide Area Information Servers (WAIS) for indexing and doing full text searches

№11 слайд
How does the Web work ? Web
Содержание слайда: How does the Web work ? Web -Designed around Client/Server Architecture Web Clients ( Web Browsers ) -send requests for documents to any Web Server Web Server -Program that responds to HTTP requests Hyperlink Web client connects to the specified Web Server The server responds by sending the information asked for The Browser formats the received HTML data and displays it

№12 слайд
How does the Web Work
Содержание слайда: How does the Web Work

№13 слайд
HTML document lt HTML gt lt
Содержание слайда: HTML document <HTML> <TITLE>Centre for Development of Advanced Computing </TITLE> <BODY BGCOLOR=“#E7CCCC” TEXT=“#000000” LINK=“#0000FF”> ... ... <A HREF=“mailto:webmaster@cdacb.ernet.in> webmaster</A> </BODY> </HTML>

№14 слайд
Содержание слайда:

№15 слайд
URLs URLs- The Hypertext
Содержание слайда: URLs URLs- The Hypertext links we use today are known as Universal Resource Locator URLs-Each name is unique across the Internet An URL looks like this http://system.domain.ext:999/dir1/dir2/dir3/file.html?blue# Parts of a URL are, Service type, System Name, Port, Directory path, Filename,Search Components or Variables Service type, System Name, Directory path are the required parts of the URL

№16 слайд
CGI Common Gateway Interface
Содержание слайда: CGI (Common Gateway Interface) CGI makes the Web a Two-way interface CGI -lets the user run a script when a web page is accessed Information from the Web Client is received through simple ‘fill-in-the-forms’ kind of interface FORMS - Integrates data sheets, menus , check boxes CGI makes the Web interactive CGI -complicated to setup ,requires PERL knowledge HTML books talk less about CGI

№17 слайд
Authoring tools and Filters
Содержание слайда: Authoring tools and Filters Authoring tools- Editors for HTML documents Editors similar to WYSIWYG word processing programs Semi-WYSIWYG or completely WYSIWYG Provide syntax checking and correction Filters -Convert legacy documents to HTML format Filters are useful when the documents already exist Authoring tools- HoTMetaL, HTML Assistant -Shareware

№18 слайд
Preconfigured v s Integrated
Содержание слайда: Preconfigured v/s Integrated Internet Products Integrated Internet Products- From multiple vendors Preconfigured Systems- Web Server and a Client ready to use Sun’s Netra Internet Server SGI’s WebFORCE Indy and WebFORCE Challenge S Apple’s Internet Server Solution DEC’s Internet AlphaServer Integraph’s Web Server 10

№19 слайд
Future Directions Additions
Содержание слайда: Future Directions Additions to HTML (Grammar, Maths, Display control) VRML (Virtual Reality Markup Language) Security - Using Scrambling and Encryption Common Client Interface (CCI)- Allows Clients to pass information back and forth between the Browser and the External Viewer Charge Mechanisms Performance Enhancements- Sending a page and graphics for that page in one connection

№20 слайд
Interesting URLs http
Содержание слайда: Interesting URLs http://www.whitehouse.gov ( The WhiteHouse) http://www.w3.org (Everything about the WWW) http://sunsite.unc.edu (Software on Sun) http://www.indnet.org (India Net Foundation Services) telnet://www.arbornet.org (Free Public Access Unix System) http://www.infoseek.com (Search engines, Add URL) http://www.infophil.com (World Alumni on the net) http://www.rocketmail.com (Free Email ) http://members.tripod.com (Free Website,2MB space) http://www.bangaloreonline.com (Offers virtual web servvices for compinies to host their website). http://www.prajavani.com (Kannada news paper on web)

№21 слайд
API Bottleneck
Содержание слайда: API Bottleneck

№22 слайд
The OS - Platform lock
Содержание слайда: The OS - Platform lock

№23 слайд
The Web
Содержание слайда: The Web

№24 слайд
Making life easier! Data on
Содержание слайда: Making life easier! Data on the web Browser platform independent Click on application - run on any machine Java the programming language of the 21 century

№25 слайд
Java and Java Computing
Содержание слайда: Java and Java Computing

№26 слайд
Java - An Introduction Java -
Содержание слайда: Java - An Introduction Java - The new programming language from Sun Microsystems Java -Allows anyone to publish a web page with Java code in it Java - CPU Independent language Created for consumer electronics Java - James , Arthur Van , and others Java -The name that survived a patent search Oak -The predecessor of Java Java is “C++ -- ++ “

№27 слайд
Java From , Ft. According to
Содержание слайда: Java From 10,000 Ft. According to the world, Java is... According to Sun, Java is... On closer inspection, Java is

№28 слайд
According to the World, Java
Содержание слайда: According to the World, Java Is... Snazzy Web pages The cross-platform language we want The rest-of-the-worlds answer to Bill The C++ replacement we need The C++ replacement we dont need A bunch of hype

№29 слайд
According to Sun, Java is...
Содержание слайда: According to Sun, Java is... Simple and Powerful Object Oriented Portable Architecture Neutral Distributed Multi-threaded Robust, Secure/Safe Interpreted High Performance Dynamic pogramming language/platform.

№30 слайд
On Closer Inspection, Java
Содержание слайда: On Closer Inspection, Java is... Simple Pure Portable Surprisingly effective

№31 слайд
As a whole, Java is a
Содержание слайда: As a whole, Java is a Comprehensive Programming Solution Object Oriented Portable High Performance Geared for Distributed Environments Secure

№32 слайд
Java as Object Oriented
Содержание слайда: Java as Object Oriented “Objects all the way down” Simple and Familiar: “C++ Lite” No Pointers! Garbage Collector Dynamic Binding Single Inheritance with “Interfaces”

№33 слайд
Java as Portable Unlike other
Содержание слайда: Java as Portable Unlike other language compilers, Java complier generates code (byte codes) for Universal Machine. Java Virtual Machine (JVM): Interprets bytecodes at runtime Architecture Neutral No Link Phase Higher Level Portable Features: AWT, Unicode

№34 слайд
Total Platform Independence
Содержание слайда: Total Platform Independence

№35 слайд
Содержание слайда:

№36 слайд
Architecture Neutral amp
Содержание слайда: Architecture Neutral & Portable Java Compiler -Java source code to bytecode Bytecode - an intermediate form, closer to machine representation A virtual machine on any target platform interprets the bytecode Porting the java system to any new platform involves writing an interpreter that supports the Java Virtual Machine The interpreter will figure out what the equivalent machine dependent code to run

№37 слайд
Java as High Performance JVM
Содержание слайда: Java as High Performance JVM uses “lean and mean” bytecodes Small binary class filtes Just-in-time Compilers Multithreading Native Methods

№38 слайд
Java in the World of
Содержание слайда: Java in the World of Distributed Computing Class Loader Lightweight Binary Class Files Multithreading Dynamic Good communication constructs Secure

№39 слайд
Java as Secure Language
Содержание слайда: Java as Secure Language designed as safe Strict compiler Dynamic Runtime Loading (Verifier) Runtime Security Manager

№40 слайд
Object Oriented Languages -a
Содержание слайда: Object Oriented Languages -a Comparison

№41 слайд
Java better than C ? No
Содержание слайда: Java better than C++ ? No Typedefs, Defines, or Preprocessor No Global Variables No Goto statements No Pointers No Unsafe Structures No Multiple Inheritance No Operator Overloading No Automatic Coercions No Fragile Data Types

№42 слайд
Basic Data Types Types
Содержание слайда: Basic Data Types Types boolean either true of false char 16 bit Unicode 1.1 byte 8-bit integer (signed) short 16-bit integer (signed) int 32-bit integer (signed) long 64-bit integer (singed) float 32-bit floating point (IEEE 754-1985) double 64-bit floating point (IEEE 754-1985) String (class for manipulating strings) Java uses Unicode to represent characters internally

№43 слайд
Java Integrates Power of
Содержание слайда: Java Integrates Power of Compiled Languages and Flexibility of Interpreted Languages

№44 слайд
Two Types of JavaApplications
Содержание слайда: Two Types of JavaApplications Different ways to write/run a Java codes are: Application- A stand-alone program that can be invoked from command line . A program that has a “main” method Applet- A program embedded in a web page , to be run when the page is browsed . A program that contains no “main” method Application -Java interpreter Applets- Java enabled web browser (Linked to HTML via <APPLET> tag. in html file)

№45 слайд
Содержание слайда:

№46 слайд
Java Development Kit javac -
Содержание слайда: Java Development Kit javac - The Java Compiler java - The Java Interpreter jdb- The Java Debugger appletviewer -Tool to run the applets javap - to print the Java bytecodes javaprof - Java profiler javadoc - documentation generator javah - creates C header files

№47 слайд
Hello Internet hello.java
Содержание слайда: Hello Internet // hello.java: Hello Internet program class HelloInternet { public static void main(String args[]) { System.out.println(“Hello Internet”); } }

№48 слайд
Program Processing
Содержание слайда: Program Processing Compilation # javac hello.java results in HelloInternet.class Execution # java HelloInternet Hello Internet #

№49 слайд
Simple Java Applet
Содержание слайда: Simple Java Applet // HelloWorld.java: A sample applet import java.applet.Applet; public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString(“Hello World !”,25,25); } }

№50 слайд
Calling an Applet lt HTML gt
Содержание слайда: Calling an Applet <HTML> <TITLE> Hello Worls Applet </TITLE> <APPLET code=“HelloWorld.class” width=500 height=500> </APPLET> </HTML>

№51 слайд
Execution of Applets
Содержание слайда: Execution of Applets

№52 слайд
Web Perspective How did Web
Содержание слайда: Web Perspective How did Web interactions work? How do they work with Java? Distributed Java objects and the Web

№53 слайд
Classical Web Perspective
Содержание слайда: Classical Web Perspective

№54 слайд
Java Web Perspective
Содержание слайда: Java Web Perspective

№55 слайд
Significance of downloading
Содержание слайда: Significance of downloading Applets Interactive WWW Flashy animation instead of static web pages Applets react to users input and dynamically change Display of dynamic data WWW with Java - more than a document publishing medium http://www.javasoft.com/applets/alpha/applets/StockDemo/standalone.html

№56 слайд
Power of Java and the Web
Содержание слайда: Power of Java and the Web Deliver applications, not just information Eliminate porting Eliminate end-user installation Slash software distribution costs Reach millions of customers - instantly

№57 слайд
Lifecycle of Java Code
Содержание слайда: Lifecycle of Java Code

№58 слайд
Bytecode Verifier Called when
Содержание слайда: Bytecode Verifier Called when class is first loaded in runtime environment Verifies bytecodes meet certain set of properties Verifier uses Theorem Prover Verified code runs faster After verification, interpreter defines memory layout

№59 слайд
Class Loader Unique Namespace
Содержание слайда: Class Loader Unique “Namespace” for each origin Local namespace classes are called “built-ins” Prevents class “spoofing”

№60 слайд
Security Manager Prevents
Содержание слайда: Security Manager Prevents unauthorized disk read/writes Restricts network access Other access restrictions (native methods) Implementation is browser dependent

№61 слайд
General Language Features C C
Содержание слайда: General Language Features C/C++ like syntax No pointers Objects all the way down Objects request services of other objects through messages Messages result in invocation of class methods

№62 слайд
Removed From C Operator
Содержание слайда: Removed From C++ Operator overloading Pointers and Array/pointers Multiple-inheritance of implementation Enum, typedef, #define Copy constructors, destructors Templates And other stuff....

№63 слайд
Added or Improved over C
Содержание слайда: Added or Improved over C++ Interfaces: type Vs. class Garbage collection Exceptions (More powerful than C++) Strings Instanceof Package Multi-threads

№64 слайд
Rich Object Environment Core
Содержание слайда: Rich Object Environment Core Classes language Utilities Input/Output Low-Level Networking Abstract Graphical User Interface Internet Classes TCP/IP Networking WWW and HTML Distributed Programs

№65 слайд
Main Packages java.lang
Содержание слайда: Main Packages java.lang java.util java.io java.awt java.awt.image java.applet java.net

№66 слайд
Java Fundamentals Constructs
Содержание слайда: Java Fundamentals Constructs Graphics Multithreading Streams and Networking Networking

№67 слайд
Unit I--Java Constructs what
Содержание слайда: Unit I--Java Constructs what is Java, basic constructs, including classes and objects constructors, this and super keywords, inheritance, abstract classes, interfaces, inner classes, exceptions.

№68 слайд
Unit II--Graphics Programming
Содержание слайда: Unit II--Graphics Programming How to build Graphical User Interfaces in Java: GUI components, event handling, layout management.

№69 слайд
Unit III--Advanced Features
Содержание слайда: Unit III--Advanced Features Applets, Threads, Streams I/O, Networking

№70 слайд
Unit I -- What is Java ? A
Содержание слайда: Unit I -- What is Java ? A programming language: Object oriented (no friends, all functions are members of classes, no function libraries -- just class libraries) simple (no pointer arithmetic, no need for programmer to deallocate memory) platform independent dynamic interpreted

№71 слайд
Types Eight basic types
Содержание слайда: Types Eight basic types 4 integers (byte, short, int, short) [ int a; ] 2 floating point (float, double) [ double a;] 1 character (char) [ char a; ] 1 boolean (boolean) [ boolean a; ] Everything else is an object String s;

№72 слайд
Classes and objects declaring
Содержание слайда: Classes and objects declaring a class class MyClass { member variables; … member functions () ; … } // end class MyClass

№73 слайд
Java programs Two kinds
Содержание слайда: Java programs Two kinds Applications have main() run from the OS prompt Applets have init(), start(), stop(), paint(), update(), repaint(), destroy() run from within a web page

№74 слайд
The first Java Application
Содержание слайда: The first Java Application class MyApp { public static void main(String s [ ] ) { System.out.println(“Hello World”); } } // end class MyApp

№75 слайд
Declaring and creating
Содержание слайда: Declaring and creating objects declare a reference String s; create/define an object s = new String (“India”);

№76 слайд
Arrays are objects in Java
Содержание слайда: Arrays (are objects in Java) declare int a [ ] ; // 1-dim int [ ] b ; // 1-dim int [ ] c [ ]; // 2-dim int c [ ][]; // 2-dim allocate space a = new int [7]; c = new int [7][11];

№77 слайд
Arrays have length used to
Содержание слайда: Arrays have length used to retrieve the size of an array int a [ ] = new int [7]; // 1-dim System.out.println(a.length); will print ‘7’ int b [ ] [ ] = new int [7] [11]; System.out.println(a.length); will print ‘7’ System.out.println(b.length * b[0].length); will print ‘77’

№78 слайд
this is because Let int array
Содержание слайда: … this is because Let int [][][][] array = new int [7][11][10][21] , then … array.length * array[3].length * array[3][5].length * array[3][5][2].length is 7 x 11 x 10 x 21

№79 слайд
this is because
Содержание слайда: … this is because

№80 слайд
Constructors All objects are
Содержание слайда: Constructors All objects are created through constructors They are invoked automatically class Weight { int lb; int oz; public Weight (int a, int b ) { lb = a; oz = b; } }

№81 слайд
this keyword refers to this
Содержание слайда: this keyword refers to “this” object (object in which it is used) usage: with an instance variable or method of “this” class as a function inside a constructor of “this” class as “this” object, when passed as parameter

№82 слайд
this with a variable refers
Содержание слайда: this :: with a variable refers to “this” object’s data member class Weight { int lb; int oz; public Weight (int lb, int oz ) { this.lb = lb; this.oz = oz; } }

№83 слайд
this with a method refers to
Содержание слайда: this :: with a method refers to another method of “this” class class Weight { public int m1 (int a) { int x = this.m2(a); return x; } public int m2(int b) { return b*7 ; } }

№84 слайд
this as a function inside a
Содержание слайда: this :: as a function inside a constructor of “this” class must be used with a constructor class Weight { int lb, oz; public Weight (int a, int b) { lb = a; oz = b; } } public Weight (int x) { this( x, 0); } }

№85 слайд
this as this object, when
Содержание слайда: this :: as “this” object, when passed as parameter refers to the object that used to call the calling method class MyApp { int a; public static void main(String [] s ) { (new MyApp()).myMethod(); } public void myMethod() { yourMethod(this); } public void yourMethod(MyApp inMyApp) { inMyApp.a = 77; } }

№86 слайд
static keyword means global
Содержание слайда: static keyword means “global”--all all objects refer to the same storage. applies to variables or methods” usage: with an instance variable of a class with a method of a class

№87 слайд
static keyword with variables
Содержание слайда: static keyword (with variables) class PurchaseOrder { private static int POCount; // var. ‘a’ is shared by all objects of this class public static void main(String [] s ) { PurchaseOrder po1 = new PurchaseOrder(); po1.updatePOCount(); } public void updatePOCount() { POCount++; } }

№88 слайд
static keyword w methods
Содержание слайда: static keyword (w/ methods)

№89 слайд
Inheritance subclassing
Содержание слайда: Inheritance (subclassing)

№90 слайд
Manager can be made a sub
Содержание слайда: Manager can be made a sub/derived-class of Employee

№91 слайд
Overriding methods
Содержание слайда: Overriding (methods)

№92 слайд
class First public First
Содержание слайда: class First { public First() { System.out.println(“ First class “); } } public class Second extends First { public Second() { System.out.println(“Second class”); } } public class Third extends Second { public Third() {System.out.println(“Third class”);} }

№93 слайд
access modifiers private same
Содержание слайда: access modifiers private same class only public everywhere protected same class, same package, any subclass (default) same class, same package

№94 слайд
super keyword refers to the
Содержание слайда: super keyword refers to the superclass (base class) usage: with a variable or method (most common with a method) as a function inside a constructor of the subclass

№95 слайд
super with a method class
Содержание слайда: super :: with a method class Manager extends Employee { private double bonus; public void setBonus(double bb) { …} public void raise(double dd) { //overrides raise() of Employee super.raise(dd); // call Employee’s raise() salary += bonus; } public Manager ( … ) { … } }

№96 слайд
super as a function inside a
Содержание слайда: super :: as a function inside a constructor of the subclass class Manager extends Employee { private double bonus; public void setBonus(double bb) { …} public Manager ( String name, double salary, double bonus ) { super(name, salary); this.bonus = bonus; } }

№97 слайд
final keyword means constant
Содержание слайда: final keyword means “constant” applies to variables (makes a var. constant), or methods (makes a method non-overridable), or classes (makes a class non-subclassable means “objects cannot be created”).

№98 слайд
final keyword with a variable
Содержание слайда: final keyword with a variable class Math { public final double pi = 3.1412; public static double method(double x) { double x = pi * pi; } } note: variable pi is made “read-only”

№99 слайд
final keyword with a method
Содержание слайда: final keyword with a method

№100 слайд
final keyword with a class
Содержание слайда: final keyword with a class

№101 слайд
abstract classes and
Содержание слайда: abstract classes and interfaces abstract classes may have both implemented and non-implemented methods interfaces have only non-implemented methods (concrete classes) have all their methods implemented

№102 слайд
sample abstract class
Содержание слайда: sample abstract class

№103 слайд
sample interface
Содержание слайда: sample interface

№104 слайд
Exceptions error handling
Содержание слайда: Exceptions (error handling)

№105 слайд
Exceptions cont d
Содержание слайда: Exceptions (cont’d)

№106 слайд
methods throwing exceptions
Содержание слайда: methods throwing exceptions

№107 слайд
Defining your own exceptions
Содержание слайда: Defining your own exceptions

№108 слайд
GUI Programming in Java AWT
Содержание слайда: GUI Programming in Java (AWT and Event Handling)

№109 слайд
AWT - Abstract Windowing
Содержание слайда: AWT - Abstract Windowing Toolkit Single Windowing Interface on Multiple Platforms Supports functions common to all window systems Uses Underlying Native Window system AWT provides GUI widgets Event Handling Containers for widgets Layout managers Graphic operations

№110 слайд
AWT - Abstract Window Toolkit
Содержание слайда: AWT - Abstract Window Toolkit Portable GUI - preserves native look & feel Standard GUI Components (buttons…) Containers - Panels, Frames, Dialogs Graphics class for custom drawing Layouts responsible for actual positioning of components: BorderLayout, GridLayout, FlowLayout, null layoit

№111 слайд
Adding Components via Layouts
Содержание слайда: Adding Components via Layouts setLayout(new BorderLayout()); // Add text field to top add("North",new TextField()); // Create the panel with buttons at the bottom... Panel p = new Panel(); // FlowLayout p.add(new Button("OK")); p.add(new Button("Cancel")); add("South",p);

№112 слайд
Adding Components via Layouts
Содержание слайда: Adding Components via Layouts

№113 слайд
Building Graphical User
Содержание слайда: Building Graphical User Interfaces import java.awt.*; Assemble the GUI use GUI components, basic components (e.g., Button, TextField) containers (Frame, Panel) set the positioning of the components use Layout Managers Attach events

№114 слайд
A sample GUI program
Содержание слайда: A sample GUI program

№115 слайд
Содержание слайда:

№116 слайд
Events
Содержание слайда: Events

№117 слайд
Events Each GUI component
Содержание слайда: Events Each GUI component (e.g., a Button) that wishes to respond to an event type (e.g., click), must register an event handler, called a Listener. The listener is an object of a "Listener" interface. A Listener class can be created by subclassing (through "implements") one of Listener interfaces (all listener inrefaces are in the java.awt.event package = > must import java.awt.event.*; ) The registration of the listener is done by a call to a method such as addActionListener(<Listener Object>). Each GUI component class has one or more such add…() methods, where applicable.

№118 слайд
Listener Interfaces
Содержание слайда: Listener Interfaces

№119 слайд
Listener Interfaces
Содержание слайда: Listener Interfaces

№120 слайд
windowActivated WindowEvent -
Содержание слайда: 1) windowActivated(WindowEvent) - Invoked when a window is activated. 2) windowClosed(WindowEvent) - Invoked when a window has been closed. 3) windowClosing(WindowEvent) - Invoked when a window is in the process of being closed. 4) windowDeactivated(WindowEvent) - Invoked when a window is de-activated. 5) windowDeiconified(WindowEvent) - Invoked when a window is de-iconified. 6) windowIconified(WindowEvent) - Invoked when a window is iconified. 7) windowOpened(WindowEvent) - Invoked when a window has been opened.

№121 слайд
How to create an object of a
Содержание слайда: How to create an object of a listener interface ?

№122 слайд
Implementing the
Содержание слайда: Implementing the ActionListener Interface and attaching an event handler to a button

№123 слайд
class MyApp implements
Содержание слайда: class MyApp implements ActionListener, WindowListener { Button b = new Button(“OK”); Frame f = new Frame(“My Frame”); public static void main(String [] s ) {(new MyApp()).go(); } public void go() { b.addActionListener( this ); f.addWindowListener( this ); } public void actionPerformed(ActionEvent e ) { … } public void windowActivated(WindowEvent e ) { … } public void windowClosed(WindowEvent e ) { … } public void windowClosing(WindowEvent e ) { … } public void windowDeactivated(WindowEvent e) { … } public void windowDeiconified(WindowEvent e) { … } public void windowIconified(WindowEvent e) { … } public void windowOpened(WindowEvent e) { … } }

№124 слайд
or use Adapters
Содержание слайда: or … use Adapters

№125 слайд
But, we can only use one
Содержание слайда: But, we can only use one Adapter at a time (no multiple inheritance)

№126 слайд
However can use inner classes
Содержание слайда: However … can use inner classes instead !!!

№127 слайд
Popup Menu and Event
Содержание слайда: Popup Menu and Event Handling... //popup.java: popup menu and event handling import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class popup extends Frame implements ActionListener, MouseListener { TextField text1; PopupMenu popup; MenuItem menuitem1, menuitem2, menuitem3; public popup() { super( "Popup Menu" ); setLayout(new FlowLayout()); setBounds(10, 10, 300, 200 ); setVisible(true); init(); } public void init() { popup = new PopupMenu("Resource Usage" );

№128 слайд
Popup Menu and Event
Содержание слайда: Popup Menu and Event Handling... menuitem1 = new MenuItem("CPU"); menuitem1.addActionListener(this); menuitem2 = new MenuItem("Disk"); menuitem2.addActionListener(this); menuitem3 = new MenuItem("Memory"); menuitem3.addActionListener(this); popup.add(menuitem1); popup.add(menuitem2); popup.add(menuitem3); add(popup); text1 = new TextField(20); text1.setBounds(20, 40, 120, 30 ); add(text1); addMouseListener(this); } public void mousePressed(MouseEvent e ) { if( e.getModifiers() != 0 ) popup.show(this, e.getX(), e.getY() ); }

№129 слайд
Popup Menu and Event Handling
Содержание слайда: Popup Menu and Event Handling public void mouseReleased( MouseEvent e ) { System.out.print("Mouse Released\n" ); } public void mouseEntered( MouseEvent e ) { System.out.print("Mouse Entered\n" ); } public void mouseExited( MouseEvent e ) { System.out.print("Mouse Exited\n" ); } public void actionPerformed( ActionEvent e ) { if( e.getSource() == menuitem1 ) { text1.setText("CPU"); } if( e.getSource() == menuitem2 ) { text1.setText("Disk"); } if( e.getSource() == menuitem3 ) { text1.setText("Memory"); } } public static void main( String args[] ) { popup p = new popup(); } }

№130 слайд
Applets and GUI
Содержание слайда: Applets and GUI

№131 слайд
AWT amp Applets
Содержание слайда: AWT & Applets

№132 слайд
Applet methods AppletContext
Содержание слайда: Applet methods AppletContext “Applet” derived from AWT Panel Hooks into Browser environment Can be used to link to another Web page

№133 слайд
A sample Applet
Содержание слайда: A sample Applet // HelloApplet.java: for processing applet methods import java.awt.*; import java.applet.*; public class HelloApplet extends Applet { public void init() { setBackground(Color.yellow); System.out.println("init() method invoked"); } public void start() { System.out.println("start() method invoked"); } public void paint( Graphics g ) { System.out.println("paint() method invoked"); g.drawString( "Hi there", 24, 25 ); } public void stop() { System.out.println("stop() method invoked"); } }

№134 слайд
sample Applet
Содержание слайда: sample Applet

№135 слайд
another sample Applet run in
Содержание слайда: another sample Applet (run in Applet Viewer)

№136 слайд
sample Applet running within
Содержание слайда: sample Applet running within Netscape

№137 слайд
sample Applet code
Содержание слайда: sample Applet code

№138 слайд
Another example MyApplet.java
Содержание слайда: Another example // MyApplet.java: draws rectangle with yellow color fill import java.applet.*; import java.awt.*; public class MyApplet extends Applet { public synchronized void paint(Graphics g) { int x,y,width,height; Dimension dm = size(); x = dm.width/4; y = dm.height / 4; width = dm.width / 2; height = dm.height / 2; // Draw the rectangle in the center with colors! g.setColor(Color.blue); g.drawRect(x,y,width,height); g.setColor(Color.yellow); g.fillRect(x + 1,y + 1,width - 2,height - 2); } }

№139 слайд
order of Applet method
Содержание слайда: order of Applet method execution

№140 слайд
order of Applet method
Содержание слайда: order of Applet method execution (cont’d)

№141 слайд
Incorporating Images and
Содержание слайда: Incorporating Images and sound in Applets

№142 слайд
sample Applet with sound
Содержание слайда: sample Applet with sound

№143 слайд
how to do that .
Содержание слайда: how to do that ….

№144 слайд
Applet that displays image
Содержание слайда: Applet that displays image

№145 слайд
Applet that plays sound
Содержание слайда: Applet that plays sound

№146 слайд
Multithreading in Java A
Содержание слайда: Multithreading in Java (A built-in feature in Java)

№147 слайд
Single and Multithreaded
Содержание слайда: Single and Multithreaded Processes

№148 слайд
Threads Java has built in
Содержание слайда: Threads Java has built in thread support for Multithreading Synchronization Thread Scheduling Inter-Thread Communication: currentThread start setPriority yield run getPriority sleep stop suspend resume Java Garbage Collector is a low-priority thread

№149 слайд
Thread states
Содержание слайда: Thread states

№150 слайд
Threading Mechanisms...
Содержание слайда: Threading Mechanisms... Create a class that extends the Thread class Create a class that implements the Runnable interface

№151 слайд
st method Extending Thread
Содержание слайда: 1st method: Extending Thread class 1st Method: Extending the Thread class class MyThread extends Thread { public void run() { // thread body of execution } } Creating thread: MyThread thr1 = new MyThread(); Start Execution: thr1.start();

№152 слайд
An example
Содержание слайда: An example

№153 слайд
nd method Threads by
Содержание слайда: 2nd method: Threads by implementing Runnable interface class MyThread implements Runnable { ..... public void run() { // thread body of execution } } Creating Object: MyThread myObject = new MyThread(); Creating Thread Object: Thread thr1 = new Thread( myObject ); Start Execution: thr1.start();

№154 слайд
An example
Содержание слайда: An example

№155 слайд
A program with two threads
Содержание слайда: A program with two threads

№156 слайд
Monitor model for
Содержание слайда: Monitor model (for Syncronisation)

№157 слайд
examples program with two
Содержание слайда: examples :: program with two threads and shared object

№158 слайд
the monitor shared object
Содержание слайда: the monitor (shared object)

№159 слайд
the driver
Содержание слайда: the driver

№160 слайд
Threads in Action...
Содержание слайда: Threads in Action... Cooperative threads - File Copy

№161 слайд
Streams and I O
Содержание слайда: Streams and I/O

№162 слайд
Streams and I O basic classes
Содержание слайда: Streams and I/O basic classes for file IO FileInputStream, for reading from a file FileOutputStream, for writing to a file Example: Open a file "myfile.txt" for reading FileInputStream fis = new FileInputStream("myfile.txt"); Open a file "outfile.txt" for writing FileOutputStream fos = new FileOutputStream ("myfile.txt");

№163 слайд
Display File Contents
Содержание слайда: Display File Contents

№164 слайд
Filters
Содержание слайда: Filters

№165 слайд
Writing data to a file using
Содержание слайда: Writing data to a file using Filters

№166 слайд
Reading data from a file
Содержание слайда: Reading data from a file using filters

№167 слайд
Object serialization
Содержание слайда: Object serialization

№168 слайд
Write an object to a file
Содержание слайда: Write an object to a file

№169 слайд
Read an object from a file
Содержание слайда: Read an object from a file

№170 слайд
Network Socket Programming in
Содержание слайда: Network/Socket Programming in Java

№171 слайд
java.net Used to manage URL
Содержание слайда: java.net Used to manage: URL streams Client/server sockets Datagrams

№172 слайд
Part III - Networking
Содержание слайда: Part III - Networking

№173 слайд
Server side Socket Operations
Содержание слайда: Server side Socket Operations 1. Open Server Socket: String server; Socket slink; DataOutputStream os; DataInputStream is; server = new ServerSocket( PORT ); 2. Wait for Client Request: Socket client = server.accept(); 3. Create I/O streams for communicating to clients is = new DataInputStream( client.getInputStream() ); os = new DataOutputStream( client.getOutputStream() ); 4. Perform communication with client Receiive from client: String line = is.readLine(); Send to client: os.writeBytes("Hello\n"); 5. Close sockets: client.close(); For multithreade server: while(true) { i. wait for client requests (step 2 above) ii. create a thread with “client” socket as parameter (the thread creates streams (as in step (3) and does communication as stated in (4). Remove thread once service is provided. }

№174 слайд
Client side Socket Operations
Содержание слайда: Client side Socket Operations 1. Get connection to server: client = new Socket( server, port_id ); 2. Create I/O streams for communicating to clients is = new DataInputStream( client.getInputStream() ); os = new DataOutputStream( client.getOutputStream() ); 3. Perform communication with client Receiive from client: String line = is.readLine(); Send to client: os.writeBytes("Hello\n"); 4. Close sockets: client.close();

№175 слайд
A simple server simplified
Содержание слайда: A simple server (simplified code)

№176 слайд
A simple client simplified
Содержание слайда: A simple client (simplified code)

№177 слайд
Echo Server Client..
Содержание слайда: Echo Server Client.. //client.java: client interface to server import java.io.*; import java.net.*; public class client { int port_id; String server; Socket slink; DataOutputStream os; DataInputStream is; DataInputStream kbd; public client( String args[] ) { server = args[0]; port_id = Integer.valueOf(args[1]).intValue(); try { slink = new Socket( server, port_id ); os = new DataOutputStream( slink.getOutputStream() ); is = new DataInputStream( slink.getInputStream() ); kbd = new DataInputStream( System.in ); }

№178 слайд
Echo Server Client.. catch
Содержание слайда: Echo Server Client.. catch( UnknownHostException e ) { System.err.println( "Don't know about host: " ); System.exit(1); } catch( IOException e ) { System.err.println( "Could not get I/O for the connection to "+server); System.exit(1); } } void communicate() { while(true) { try { System.out.print("Enter Input <end to stop>: "); String line = kbd.readLine(); os.writeBytes( line+"\n" );

№179 слайд
Echo Server Client.. if
Содержание слайда: Echo Server Client.. if( line.equals("end") ) { os.close(); is.close(); slink.close(); break; } String line2 = is.readLine(); System.out.println("Output: "+line2); } catch( IOException e ) { System.out.println(e); } } } public static void main( String [] args ) { if( args.length < 2 ) { System.out.println("Usage: java client server_name port_id" ); System.exit(1); } client cln = new client( args ); cln.communicate(); } }

№180 слайд
Echo Server ... server.java
Содержание слайда: Echo Server ... // server.java: echo server import java.io.*; import java.net.*; public class server { // public final static int PORT = 4779; public static void main( String [] args ) { ServerSocket server = null; DataOutputStream os = null; DataInputStream is = null; boolean shutdown = false; if( args.length < 1 ) { System.out.println( "Usage: java server port_num" ); System.exit( 1 ); } int PORT = Integer.valueOf(args[0]).intValue(); try { server = new ServerSocket( PORT ); }

№181 слайд
Echo Server ... catch
Содержание слайда: Echo Server ... catch( IOException e ) { System.err.println( "Could not get I/O for the connection to: "); } while(!shutdown) { if( server != null ) { try { Socket client = server.accept(); System.out.println("Connected"); InetAddress cip = client.getInetAddress(); System.out.println( "Client IP Addr: "+cip.toString()); is = new DataInputStream( client.getInputStream() ); os = new DataOutputStream( client.getOutputStream() ); for(;;) { String line = is.readLine(); if( line == null ) break;

№182 слайд
Echo Server ... if
Содержание слайда: Echo Server ... if( line.startsWith("end" ) ) { shutdown = true; break; } os.writeBytes(line.toUpperCase()); os.writeBytes("\n"); System.out.println(line); } is.close(); client.close(); } catch( UnknownHostException e ) { System.err.println( "Server Open fails" ); } catch( IOException e ) { System.err.println( "Could not get I/O for the connection to:"+args[0]); } } }

№183 слайд
Echo Server
Содержание слайда: Echo Server System.out.println( "Server Down" ); try { server.close(); } catch(IOException e) {} } }

№184 слайд
Содержание слайда:

№185 слайд
Java System Architecture amp
Содержание слайда: Java System Architecture & Availability

№186 слайд
A Look Inside the Java
Содержание слайда: A Look Inside the Java Platform

№187 слайд
Java Applications! Java
Содержание слайда: Java Applications! Java applications are now available Cost of manfg zero, cost of distribution zero, cost of marketing zero! Hot Java is lean - loads everything else from the net. Java itself is small - 40k to 225k New class of small machines will emerge Java on cellular phones, credit cards, washing machines, and everywhere ?

№188 слайд
Universal Interface
Содержание слайда: Universal Interface

№189 слайд
Java on my platform ? Sun
Содержание слайда: Java on my platform ? Sun (SPARC) ftp://java.sun.com Sun(x86) ftp://xm.com:/pub/ IBM(Aix, OS/2)ftp://ncc.hursley.ibm.com/javainfo DEC(Alpha OSF/1) http://www.gr.osf.org:8001/projects/web/java/ SGI http://liawww.epfl.ch/~simon/java/irix-jdk.html HP http://www.gr.osf.org:8001/projects/web/java Linux http://www.blackdown.org AT & T http://www.gr.osf.org:8001/projects/web/java Windows 3.1 http://www.alphaworks.ibm.com

№190 слайд
Java Development Tools
Содержание слайда: Java Development Tools (Present and Planned)

№191 слайд
Sun s Java WorkShop JDK
Содержание слайда: Sun’s Java WorkShop JDK: Compiler and runtime environment Class Libraries Documentation javadoc - Automated Documentation Takes comments and converts to HTML IDE: Visual Java, and integrated tools, JavaBeans Other Products and API: JavaHelp, Java Card, Java Blend, JavaOS, Java Mail, Java Management, Java Electronic Commerce Framework Java Enterprise API: Java Naming and Directory Interface, Java IDL, JDBC, RMI and Object Serialization

№192 слайд
Symantec Cafe . Released Full
Содержание слайда: Symantec Cafe 1.0 (Released) Full IDE for Windows 95/NT Graphic Development Tools Two Compilers Debugger Class Browser

№193 слайд
Microsoft Jakarta Planned
Содержание слайда: Microsoft Jakarta (Planned) Visual C++ type interface Will Support ActiveX/COM Internet Explorer 3.0 will have Just-In-Time Java compiler

№194 слайд
Borland JBuilder Visual RAD
Содержание слайда: Borland JBuilder Visual RAD workbench for maximum productivity. Rapid Application Development (RAD) and Open Component Architecture patterned after Delphi. 100+ JavaBean components, with source code, for drag-and-drop applications. Beans Express--easiest way to create industry-standard Java-Bean components. DataExpress -- the fastest way to build business and database appplications. Borland DataGateway for Java connectivity to all major database servers. Multi-tier applications with integrated RMI and CORBA. Versions: Standard, Professional, & Client/Server

№195 слайд
Challenges amp Possible
Содержание слайда: Challenges & Possible Directions Performance AWT - need better GUI! Maintaining Interoperability Security - current restrictions limit what can be done Native Compilers Is Portability that Important?

№196 слайд
Comments Java is a fun and
Содержание слайда: Comments Java is a fun and easy programming language Portability = Mediocrity? Java will become a programming language of choice, but may take on a final form that will surprise many!

№197 слайд
JDBC Java API for Relational
Содержание слайда: JDBC Java API for Relational Databases Being standardized by all major players

№198 слайд
Javascript and Java Preview
Содержание слайда: Javascript and Java (Preview) Javascript can control Java applets Static data accessible as properties of applet var i = Bank.Account.count Public methods invocable on Java instances Provided those instances are accessible through the Applet Applet is accessible through document document.applet_Name_Attribute.do_Stuff()

№199 слайд
Java for HPC! Many efforts
Содержание слайда: Java for HPC! Many efforts are in in progress for making java as a language for parallel programming. Java computing frameworks (HPC, numeric, data parallel) Java in distributed simulations and applications (e.g., real-world HPC, grand chalenge) Source to source translators (C, Fortran, C++ to Java) Web based computation environment in Java Java for HPC conference: http://www.cs.ucsb.edu/conferences/java98 Java for Science and Engineering computing: subscribe java-for-cse to majordomo@npac.syr.edu http://www.jhpc.org

№200 слайд
How to Convert Programs to
Содержание слайда: How to Convert Programs to AWT 1.1... 1. Change source code so that it import event package: import java.awt.event.*; 2. Figure out which component generates each event type: (1.0 uses handleEvent() and action()) Button, List, MenuItem, TextField: Interface: ActionListener Method: actionPerformed(ActionEvent event) Checkbox, CheckboxMenuItem, Choice: Interface: ItemListener Method: itemStateChanged(..) Dialog, Frame: Interface: WindowListener Method: windowClosing(), windowOpened(),...

№201 слайд
How to Convert Programs to
Содержание слайда: How to Convert Programs to AWT 1.1... 3. Change class declaration so that class implements public class MyClass extends SomeComponent implements ActionListener 4. Register action Listener newComponentObject.addActionListener(this); 5. Change event handling method: Old: public boolean action(Event e, Object arg) New: public void actionPerformed(ActionEvent e)

№202 слайд
How to Convert Programs to
Содержание слайда: How to Convert Programs to AWT 1.1 6. Delete the event handling code in this way (a) Delete all return statements (b) Change e.target to e.getSource() (c) Delete all code the unnecessarily tests for which component the event come from (d) Perform any other modification require to make the program compile

№203 слайд
Just to Summarize Java as a
Содержание слайда: Just to Summarize Java as a Comprehensive Programming Solution Object Oriented Portable High Performance Geared for Distributed Environments Secure Highly suitable for Internet programming

№204 слайд
Summary Java is really very
Содержание слайда: Summary Java is really very well poised Incredible leverage from the Web Will impact the C++ and Smalltalk markets Rate of progress is astonishingly high Development environments CORBA linkages Components Fasten you seat-belts!

№205 слайд
Содержание слайда:

Скачать все slide презентации Internet and Java Foundations, Programming and Practice одним архивом: