The tag The complete syntax of the tag is as follows( code, width and height are required and others optional) <applet [ codebase = applet_url] code =

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 10 Applets.
Advertisements

Working with Images and HTML
Internet Basics & Way Beyond!
Tutorial 4: Designing a Web Page with Tables
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 18 Applets and Multimedia.
Cos 125 DAY 14. Agenda Assignment #3 Graded 7 A’s, 2 B’s, 1 C Problems are mostly caused by not following the instructions Assignment 4 Posted Due March.
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.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Introduction to Java Applets Outline 3.1 Introduction 3.2 Sample Applets from the Java 2.
1 Applets. 2 Motivations When browsing the Web, you frequently see the graphical user interface and animation developed using Java. These programs are.
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.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 14 Applets, Images,
Cos 125 DAY 14. Agenda Assignment #3 Graded 11 A’s, 5 non-submits Problems include Not uploading assignment sheet in WebCT Not uploading graphics to web.
Chapter 3 - Introduction to Java Applets Outline 3.1Introduction 3.2Thinking About Objects 3.4A Simple Java Applet: Drawing a String 3.5Two More Simple.
EE2E1. JAVA Programming Lecture 10 Applets. Contents Introduction Introduction Web-servers and clients Web-servers and clients A simple example “Hello.
Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L05 (Chapter 16) Applets.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 9: Frames © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page Design.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 9: HTML Frames.
Images and Tables. Displaying Image Attributes: SRC= " mypic.gif " – Name of the picture file SRC= " pic/mygif.jpg " – Name of file found in pic directory.
Java Server Pages CS-422. What are JSPs A logical evolution of java servlets –most servlets dynamically create HTML and integrate it with some computational.
Applets  The Applet Class  The HTML Tag F Passing Parameters to Applets.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
Slides © Marty Hall, book © Sun Microsystems Press 1 Including Files & Applets in JSP Documents Core Servlets & JSP book:
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.
Informatics Computer School CS114 Web Publishing HTML Lesson 2.
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.
1 APPLETS. 2 Applets are small applications that are accessed on an Internet server, transported over the Internet, automatically installed, and run as.
Georgia Institute of Technology Workshop for Programming And Systems Management Teachers Chapter 9 Source File Anatomy.
Introduction to Applets CS 3505 Client Side Scripting with applets.
1 Introduction to Applets. 2 Applications Programs that execute using the java interpreter Executes in command windows.
COP 4331 – OOD&P Lecture 6. Review Midterm Review Complete sample application –See SwingColorTest.java.
HTML: Tables & Frames Internet Technology.
Introduction to Java Applets Sangeetha Parthasarathy 05/21/2001.
1 CSC Computer Education (P) Ltd. DESIGNED BY K PRAKASH,
Pravin Yannawar, DOCS, NMU Jalgaon Basic Java : Applets 2 Objectives of This Session Identify the need for Applets Distinguish between Applets and Applications.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Adding Graphical Elements Essentials for.
HTML Lesson 3 Hyper Text Markup Language. Assignment Part 2  Set the file name as “FirstName2.htm”  Set the title as “FirstName LastName First Web Site”
Tables in HTML. Table Tag HTML tables always begin and end with a table tag. Syntax:
LECTURE 18 Java and Web Pages. Java Savvy Browser A browser capable of handling java applets: - Netscape Navigator - Microsoft Internet Explorer - Sun.
Internet Applications Development Lecture 4 L. Obead Alhadreti.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
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.
HTML IMAGES. CONTENTS IMG Tag Alt Attribute Setting Width and Height Of An Image Summary Exercise.
Applets, Images, and Audio Chapter 14 CSCI CSCI 1302 – Applets, Images, and Audio2 Outline Introduction The Applet Class –The init Method –The start.
CSC 243 – Java Programming, Spring, 2014 April 22, 2014 Week 13, JApplets.
Creating a Java Application and Applet
HTML CS 105. Page Structure HTML elements control the details of how a page gets displayed. Every HTML document has the following basic structure: … …
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.
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.
REEM ALMOTIRI Information Technology Department Majmaah University.
Web111a_chapt04.ppt HTM: Section 4 Tables Table Types Text table elements Easy to use Use fixed-font text (font family monospace) Andale Mono Courier Monaco.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Introduction to Java Applets Will not cover Section 3.7 Thinking About Objects: Identifying.
1 Applets Programming. Introduction Java programs are divided into two main categories, applets and applications. An application is an ordinary Java program.
JAVA Applets Pavan D.M..
Linking With Graphics INP150: Basic HTML March 25, 2002.
JAVA Applets Pavan D.M..
Java Applet.
Applets In Java Visit for more Learning Resources 1.
30 Java Applets.
Distributed Computing, M. L. Liu
Distributed Computing, M. L. Liu
APPLETS.
Java Applets.
APPLETS.
Lesson 5: HTML Tables.
Presentation transcript:

The tag The complete syntax of the tag is as follows( code, width and height are required and others optional) <applet [ codebase = applet_url] code = classname.class width = applet_viewing_width_in_pixels height = applet_viewing_height_pixels [archive = archivefile] [vspace = vertical_margin [hspace = horizontal_margin] [align = applet_alignment] [alt = alternative_text] >

Codebase Specify where your class is loaded If not used, the browser loads the applet from the directory in which the HTML page is loaded. This attribute enables you to load the class from anywhere on the internet The classes are dynamically loaded when needed

Archive Archive instructs the browser to load an archive file that contains all the class files needed to run the applet. Archiving allows the browser to load all the classes from a single compressed file at one time, thus reducing loading time and improving performance (see section Packaging and Deploying Java Project)

Vspace, hspace, align and alt Specify the size, in pixels, of the blank margin to pad around the applet vertically and horizontally Align specifies how the applet will be aligned in the browser. Values are left, right,top,texttop, middle, absmiddle, baseline, bottom or absbottom. Alt attribute specifies the text to be displayed in case the browser cannot run Java.

Passing parameters to applets A parameter must be declared in the HTML file Must be read by the applet when it is initialized. Parameters are declared using the tag The tag must be embedded in the tag Read parameter from applet message = getParameter(“MESSAGE”); getParameter(“X”); getParameter(“Y”);

Example - HTML Passing parameters to Java Applet This applet gets a message from the HTML page and display it

Read parameters from an applet public class Display Message extends Japplet{ private String mes = “A default message”; private int x = 10; private int y = 10; public void init() { mes = getParameter(“MESSAGE”); x = Integer.parseInt(getParameter(“X”)); y = Integer.parseInt(getParameter(“Y”)); JLabel lb = new JLabel(mes); lb.setXCoordinator(x); lb.setYCoordinator(y); getContentPane().add(lb); }