Introduction to Applet, Application and JDK

Slides:



Advertisements
Similar presentations
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Advertisements

Java Applet & JavaScript SNU OOPSLA Lab. October 2005.
got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999.
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.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
Applets, Graphical User Interfaces, and Threads / Chapter 9 1 Applets, Graphical User Interfaces, and Threads.
Java Applets. Road Map Introduction to Java Applets Review applets that ship with JDK Make our own simple applets –Introduce inheritance –Introduce the.
Introduction to Java Programming. Contents 1. Java, etc. 2. Java's Advantages 3. Java's Disadvantages 4. Types of Java Code 5. Java Bytecodes 6. Steps.
CSTP WS00CS423 (cotter)1 Java Applets Objective: Learn how to develop Java programs that interact with users through a Web browser.
Tutorial 7 Working with Multimedia. XP Introducing Multimedia Bandwidth is a measure of the amount of data that can be sent through a communication pipeline.
Java Lecture 16: Dolores Zage. WWW n Was a method for distributing passive information n added forms and image maps n interaction was only a new way to.
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.
Internet Software Development Applets Paul J Krause.
Applets.
Applets An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included.
Java Applets. 2 Introduction to Java Applet Programs  Applications are stand alone programs executed with Java interpreter executed with Java interpreter.
OOP (Java): Simple/ OOP (Java) Objectives – –give some simple examples of Java applications and one applet 2. Simple Java Programs Semester.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Java Tutorial Ethan New York University.
Applets & Graphics. Applets programs that run inside a browser Java platform-independence makes applets possible security restrictions: –cannot read or.
1 CSC Computer Education (P) Ltd. DESIGNED BY K PRAKASH,
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
Lec.10 + (Chapter 8 & 9) GUI Java Applet Jiang (Jen) ZHENG July 6 th, 2005.
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.
Java applets. Outline What is Java? Java Applications Java Applets Java Applets Securities Summary.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 35 – Overview of Java Web Programming Webpage:
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.
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.
Applets Java code is compiled into byte code instead of machine language –Languages like C, C++, Pascal and others are compiled into machine language so.
1 Applets. 2 What is an applet? Applet: a Java program that can be inserted into a web page and run by loading that page in a browser brings web pages.
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.
1 Java Applet Basics Chapter Eight. 2 Applets vs. Applications l Applications: Stand alone Java programs run by interpreter l Applets WWW browser embedded.
Client-Server applications Introduction to Java Applets Client-server architectures Why do Applets exist? What can an Applet do?
ITP 109 Week 2 Trina Gregory Introduction to Java.
1 Applets Programming. Introduction Java programs are divided into two main categories, applets and applications. An application is an ordinary Java program.
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.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Applications Active Web Documents Active Web Documents.
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
Java Applet.
Applets In Java Visit for more Learning Resources 1.
Tutorial 7 Working with Multimedia
Distributed Computing, M. L. Liu
Distributed Computing, M. L. Liu
Applets.
UNIT-5.
Introduction to Computing Using Java
Java Applets.
Introduction CSC 111.
Working with Multimedia
Java applets 1/3/2019.
Teaching slides Chapter 6.
CSC 551: Web Programming Spring 2004
APPLETS.
Applet in Java.
CSC 551: Web Programming Spring 2004
Java Programming COMP-417 Applet
Applet Fundamentals Applet are small applications that are accessed on an Internet server, transported over the Internet, automatically installed and run.
11.1 Applets & graphics.
Handout-14 Applets and Graphics
JAVA APPLET PREPARED BY Mr. Jahanzaib Ahmed
Enabling Application Delivery Via the Web
G6DICP - Lecture 27 Java Applets.
APPLET PROGRAMMING.
Presentation transcript:

Introduction to Applet, Application and JDK Mrs. Reetu Dahiya |unit 7

INTRODUCTION To JAVA APPLETS Applets are small JAVA programs that are primarily used in INTERNET COMPUTING. An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page.

Application Application are simple java programs that can be created using java development kit like the applications of other simple languages. They can do the simple as well as toughest jobs for us in the same manner like other language programs do. They use main() function or method initiating the execution of a code. They are stand alone programs that can read from or write to the files in local computer. They can be executed by or execute other programs in a local computer as well as they can be compiled debugged and modified on a local computer in a simple and easy way.

Difference between applets and applications Applets cannot read or write to the file system i.e. They cannot read or write files on the use is system while the application can do so. Applets cannot communicate with any other server than the one in which they were stored originally. Applets cannot load or run any programs stored on the system while application do so. Applets can only executed inside a web page using a special feature called HTML tag which a stand alone application does not have such restriction. Applets do not use the main() method while application do so. The execution on an applet starts with entirely different mechanism than that of application execution.

How APPLETS GETS EXECUTED? When you use a Java technology-enabled browser (any Browsers like IE, Opera, Mozilla, Chrome) to view a page that contains an applet, the applet's code is transferred to your system and executed by the browser's Java Virtual Machine (JVM) The JDK also comes with an applet viewer. The JDK applet viewer is really just a minimum browser. It only understands the applet tag.

Java Plug-in Plug-in is used to view static HTML pages. Java Plug-in software enables enterprise customers to direct applets or beans written in the Java programming language on their intranet web pages to run using Sun's Java Runtime Environment (JRE). This enables an enterprise to deploy applets that take full advantage of the latest capabilities and features of the Java platform and be assured that they will run reliably and consistently.

An Overview of JAVA APPLETS Applets are used to provide interactive features to web applications that cannot be provided by HTML alone. They can capture mouse input and also have controls like buttons or check boxes. In response to the user action an applet can change the provided graphic content. This makes applets well suitable for demonstration, visualization and teaching. There are online applet collections for studying various subjects, from physics to heart physiology. Applets are also used to create online game collections that allow players to compete against live opponents in real-time.

An Overview of JAVA APPLETS Applets can also play media in formats that are not natively supported by the browsers. Provides an Interactive way to understand any needed information's. HTML pages may be embedded to the applet. Hence the same applet may appear differently depending on the parameters that were passed.

Embedding The applet can be displayed on the web page by making use of the applet HTML element, or the recommended object element. Embed element can be used with Mozilla family browsers (embed is no longer available in browsers since HTML 5). This specifies the applet's source and location. Object and embed tags can also download and install Java virtual machine (if required) or at least lead to the plug-in page. Applet and object tags also support loading of the serialized applets that start in some particular (rather than initial) state. It is possible to embed a video files from any video broadcasting sites such as YOUTUBE, Videojug, e-how…etcetera.

Applet Life Cycle init ( ) start ( ) stop ( ) destroy ( ) Called when applet is loaded onto user’s machine. Prep work or one-time-only work done at this time. start ( ) Called when applet becomes visible (page called up). Called every time applet becomes visible. stop ( ) Called when applet becomes hidden (page loses focus). destroy ( ) Guaranteed to be called when browser shuts down.

Examples import java.applet.Applet; import java.awt.*; These Header files are mandatory for an Applet program. Ex: Import java.awt.*; Import java.applet.*; Public class HelloJava extends Applet { Public void paint(Graphics g) { g.drawString(“Hello Java”, 10, 100);//It represents pixels g.setColor(Color.black); } }

Inserting Applets codes into HTML Page <HEAD> <TITLE>HelloWorld_example.html</TITLE> </HEAD> <BODY> <H1>A Java applet example</H1> <P>Here it is: <APPLET code="HelloWorld.class" WIDTH="200" HEIGHT="40"> </APPLET></P>//Inserting “HelloWorld.class” file into a HTML page. </BODY> </HTML> When inserting a class file into a HTML page, Width and Height sizes are compulsory (can be represented either in percent or pixels).

Advantages of JAVA APPLETS It is simple to make it work on Linux, Microsoft Windows and Mac OS X i.e. to make it cross platform. The same applet can work on "all" installed versions of Java at the same time. It can move the work from the server to the client, making a web solution more scalable with the number of users/clients. The applet naturally supports the changing user state An un-trusted applet has no access to the local machine and can only access the server it came from. Java applets are fast - and can even have similar performance to native installed software.

Disadvantages of JAVA APPLETS It requires the Java plug-in. Some browsers, notably mobile browsers running Apple iOS or Android do not run Java applets at all. Some organizations only allow software installed by the administrators. As a result, some users can only view applets that are important enough to justify contacting the administrator to request installation of the Java plug-in.

Parameter Passing to Applets import java.applet.*; import java.awt.*; public class FontApplet extends Applet { public void paint (Graphics g){ String fontName = getParameter ("font"); int fontSize = Integer.parseInt (getParameter("size")); Font f = new Font(fontName, Font.BOLD, fontSize); g.setFont (f); g.drawString("Welcome to CS423", 25, 50); }

HTML file for parameter <TITLE> FontApplet </TITLE> <BODY background=“Image1.jpg”> Here’s a demo of parameter passing to an Applet <hr> <APPLET CODE = "FontApplet" WIDTH = 300 HEIGHT = 200> <PARAM NAME = font VALUE = "Helvetica"> <PARAM NAME = size VALUE = "24"> </APPLET> </BODY> </HTML>

Questions?

Thankyou