Applets, Graphical User Interfaces, and Threads / Chapter 9 1 Applets, Graphical User Interfaces, and Threads.

Slides:



Advertisements
Similar presentations
1 Applets Programming Enabling Application Delivery Via the Web.
Advertisements

Java Applets:. How Applets differ from application?: They do not use main method but init(), start() and paint() methods of the applet class They can.
Java Applets. An applet is a Panel that allows interaction with a Java program. A applet is typically embedded in a Web page and can be run from a browser.
Object Oriented Programming with Java (150704).   Applet  AWT (Abstract Window Toolkit)  Japplet  Swing Types of Applet.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 1 Introducing Java.
Java Applet & JavaScript SNU OOPSLA Lab. October 2005.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Lecture 24 Applets. Introduction to Applets Applets should NOT have main method but rather init, stop, paint etc They should be run through javac compiler.
Applets. The Applet Class public class MyApplet extends java.applet.Applet {... /** The no-arg constructor is called by the browser when the Web page.
Review of Java Applets Vijayan Sugumaran Decision and Information Sciences Oakland University.
1 Introduction to Applets Overview l What is an Applet? l Steps for creating an applet l What is HTML? l Basic HTML tags l Drawing Simple Graphical shapes.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 16 Applets.
Applets. An applet is a Panel that allows interaction with a Java program A applet is typically embedded in a Web page and can be run from a browser You.
26-Jun-15 Applets. 2 An applet is a Panel that allows interaction with a Java program A applet is typically embedded in a Web page and can be run from.
Object Oriented Programming (OOP) LAB # 5 TA. Maram & TA. Mubaraka TA. Kholood & TA. Aamal.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L05 (Chapter 16) Applets.
CSTP WS00CS423 (cotter)1 Java Applets Objective: Learn how to develop Java programs that interact with users through a Web browser.
Applets  The Applet Class  The HTML Tag F Passing Parameters to Applets.
Applets Java API.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
JAVA APPLETS By: Ms. Humaira Siddiqui. Java and the Internet Java is considered to be a language well suited to be used in the internet. In contrast with.
Applets Chapter 17.  Java’s big splash onto the scene came in the mid 90’s. The people at Sun Microsystems had managed to work java programs into Web.
Internet Software Development Applets Paul J Krause.
Applets.
1 Programming Fundamentals AITI-GP. 2 Introduction to Programming.
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Introduction to Applets Course Lecture Slides 29 th July 2010.
Chapter 10: Applets and Advanced Graphics The Applet Class The Applet Class The HTML Tag The HTML Tag Passing Parameters to Applets Passing Parameters.
Java Applets. An applet is a Panel that allows interaction with a Java program. A applet is typically embedded in a Web page and can be run from a browser.
Introduction to Java Applets Sangeetha Parthasarathy 05/21/2001.
Applets. What is an applet? Why create applets instead of applications? – Applets are Java programs that can be embedded in an HTML document – In contrast,
1 CSC Computer Education (P) Ltd. DESIGNED BY K PRAKASH,
Java Applets 1. What is an applet? An applet is a small Java program that is typically embedded in a Web page and can be run using the applet viewer or.
CSC 205 – Java Programming II Applet. Types of Java Programs Applets Applications Console applications Graphics applications Applications are stand-alone.
Pravin Yannawar, DOCS, NMU Jalgaon Basic Java : Applets 2 Objectives of This Session Identify the need for Applets Distinguish between Applets and Applications.
Program that runs in appletviewer (test utility for applets) Web browser (IE, Communicator) Executes when HTML (Hypertext Markup Language) document containing.
Chapter 6 Applets and HTML  Overview  HTML tags for Applets  Applet Life Cycle  Applet Class  JAR files.
Applets Yong Choi School of Business CSU, Bakersfield.
Chapter 14 Applets and Advanced GUI  The Applet Class  The HTML Tag F Passing Parameters to Applets F Conversions Between Applications and Applets F.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Chapter 8 (Horstmann’s Book) Frameworks Hwajung Lee.
Your name CSCI/CMPE 3326 Object-Oriented Programming in Java Dongchul Kim Department of Computer Science University of Texas – Pan American 1.Applet.
1 Applets are small applications that are accessed on an Internet server, transported over the internet, automatically installed and run as a part of web.
Chapter 8 Frameworks. Frameworks Framework is a set of cooperating classes and interface types that structures the essential mechanisms of a particular.
1 Applets. 2 Design of Applets 3 Sun wrote Java to be executable within a hosting application browser The applications are applets. An applet is downloaded.
CSI 3125, Preliminaries, page 1 Applet. CSI 3125, Preliminaries, page 2 Applet An applet is a Java program that runs in a Web browser. An applet can be.
Introduction to Applets Chapter 21. Applets An applet is a Java application that is intended to be invoked and executed through a Web browser. Click Here.
CHAPTER Agenda Applets Servelets Browsers HelloWorld.
HTML Overview Part 8 – Java Applets 1. Applets 2  A Java applet is a small application embedded in your HTML document which runs in the browser window.
1 Java Applet Basics Chapter Eight. 2 Applets vs. Applications l Applications: Stand alone Java programs run by interpreter l Applets WWW browser embedded.
IT11 Agenda for Feb Golden Rule Reminder. 2. PowerPoint demonstration on the structure of Java Applet programs. Source Files HTML Files Class Files.
1 Applets Programming. Introduction Java programs are divided into two main categories, applets and applications. An application is an ordinary Java program.
CS202 Java Object Oriented Programming GUI Programming – Applets Chengyu Sun California State University, Los Angeles.
Java Applets Getting Started. Import Files In order to run the applet properly, we have to import some files into our class. These files are: –import.
Applet: An applet is a java program that is transmitted over the network from the server to client & executed within clients browser. Applets are used.
Applets.
Lecture 09 Applets.
Java Applet.
Distributed Computing, M. L. Liu
Distributed Computing, M. L. Liu
UNIT-5.
Java applets 1/3/2019.
Applet in Java.
Java Programming COMP-417 Applet
11.1 Applets & graphics.
Handout-14 Applets and Graphics
JAVA APPLET PREPARED BY Mr. Jahanzaib Ahmed
Enabling Application Delivery Via the Web
ITEC324 Principle of CS III
G6DICP - Lecture 27 Java Applets.
APPLET PROGRAMMING.
Presentation transcript:

Applets, Graphical User Interfaces, and Threads / Chapter 9 1 Applets, Graphical User Interfaces, and Threads

Applets, Graphical User Interfaces, and Threads / Chapter 9 2 Interface ? an agent between two entities

Applets, Graphical User Interfaces, and Threads / Chapter 9 3 Interface

Applets, Graphical User Interfaces, and Threads / Chapter 9 4 Interface

Applets, Graphical User Interfaces, and Threads / Chapter 9 5 Interface

Applets, Graphical User Interfaces, and Threads / Chapter 9 6 Interfaces ATM machine remote control bank teller browser (Netscape Navigator or Internet Explorer) real interfaces

Applets, Graphical User Interfaces, and Threads / Chapter 9 7 Interfaces are designed to handle events initiated by user

Applets, Graphical User Interfaces, and Threads / Chapter 9 8 Events single click double click dragging

Applets, Graphical User Interfaces, and Threads / Chapter 9 9 Events An applet has mechanisms to handle events

Applets, Graphical User Interfaces, and Threads / Chapter 9 10 Applet A Java programs designed to run in a browser

Applets, Graphical User Interfaces, and Threads / Chapter 9 11 Applet applet class files are embedded in a HTML document

Applets, Graphical User Interfaces, and Threads / Chapter 9 12 all applets are subclasses of the applet class Applet public class SomeApplet extends Applet{ … }

Applets, Graphical User Interfaces, and Threads / Chapter 9 13 Applets differ from applications in that a browser controls the applet’s execution Applet

Applets, Graphical User Interfaces, and Threads / Chapter 9 14 the browser calls your applet's init() method when the applet is started. An applet's start() and stop() methods are called when the page where the applet is running gains or loses focus. Applet

Applets, Graphical User Interfaces, and Threads / Chapter 9 15 Why Restrict Applets ? An applet is code from another machine that you are not familiar

Applets, Graphical User Interfaces, and Threads / Chapter 9 16 Applet Restrictions cannot automatically send information to a user’s printer prevented from performing file operations prevented from certain network activities

Applets, Graphical User Interfaces, and Threads / Chapter 9 17 Applet Restriction Relaxed can be relaxed by changing the browser’s security settings

Applets, Graphical User Interfaces, and Threads / Chapter 9 18 Applet Syntax public class appletName extends Applet{ … }

Applets, Graphical User Interfaces, and Threads / Chapter 9 19 Sample Applet import java.applet.Applet; import java.awt.Graphics; public class Welcome extends Applet { public void paint(Graphics g){ g.drawString("Java is fuuuuuuuuuun :)...",25,25); }

Applets, Graphical User Interfaces, and Threads / Chapter 9 20 Applet’s HTML File the HTML file name does not have to match the name of the class name as in the java file however, the class name in the applet code tag must match the class name

Applets, Graphical User Interfaces, and Threads / Chapter 9 21 Applet’s HTML File the area of the applet is determined by the width and height parameters

Applets, Graphical User Interfaces, and Threads / Chapter 9 22 Applet Template import java.awt.*; import java.applet.*; public class SampleApplet extends Applet{ public void init(){ System.out.println("SampleApplet.init() executed"); } public void paint(Graphics g){ } public void start(){ } public void stop(){ } }

Applets, Graphical User Interfaces, and Threads / Chapter 9 23 Applet’s Life the browser manages the life cycle of the applet the life cycle includes the following › init › start › stop › destroy paint

Applets, Graphical User Interfaces, and Threads / Chapter 9 24 Applet Methods (init) called when an applet begins called once during the applet’s execution code to initialize the applet is placed in init()

Applets, Graphical User Interfaces, and Threads / Chapter 9 25 Applet Methods (start) called immediately after init() when the page where the applet is running gains focus

Applets, Graphical User Interfaces, and Threads / Chapter 9 26 Applet Methods (stop) called when the page where the applet is running loses focus

Applets, Graphical User Interfaces, and Threads / Chapter 9 27 Applet Methods (destroy) called when the browser terminates

Applets, Graphical User Interfaces, and Threads / Chapter 9 28 Applet Methods (paint) refreshes the browser display