Chapter 131 Applets and HTML Chapter 13. 2 Reminders Project 8 due Dec 10:30 pm Project 6 regrades due by midnight tonight –Submit all files (including.

Slides:



Advertisements
Similar presentations
Learn about Java applets. Know the differences between Java applets and applications. Designing and using Java applets Running Java applets. Security.
Advertisements

Dept. of Computer Science - SSBN Java Applets Vishnuvardhan.M.
Html: getting started HTML is hyper text markup language. It is what web browsers look at on the Internet. HTML documents should be created in a simple.
Chapter 12 Creating and Using Templates. If you have already created and designed a page you like, you can use the layout and design for other pages in.
MIS 425 Lecture 1 – HTML Basics and Web Page Design Instructor: Martin Neuhard
Slides prepared by Rose Williams, Binghamton University Mouse Events + Chapter 17: Applets.
Slides prepared by Rose Williams, Binghamton University Chapter 18 Applets.
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.
Chapter 12Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Announcements/Reminders l Happy Tax Day! l Project 8 due on Thursday.
Chapter 14 Applets. 2 Knowledge Goals Understand the differing roles of applications and applets Understand how a browser operates Understand the role.
Slides prepared by Rose Williams, Binghamton University Chapter 18 Applets.
1 CA201 Word Application Creating Document for the Web Week # 9 By Tariq Ibn Aziz Dammam Community college.
Java Applets. Lecture Objectives Learn about Java applets. Know the differences between Java applets and applications. Designing and using Java applets.
28-Jun-15 Applets. 2 An applet is a program that is typically embedded in a Web page and can be run from a browser You need special HTML in the Web page.
HTML Companion. Lecture Objectives Learn about HTML. Know basic HTML tags.
Chapter 20 Applets Slides prepared by Rose Williams, Binghamton University Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
Applets, HTML and GUI’s Recitation – 04/11/2008 CS 180 Department of Computer Science, Purdue University.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
COMPUTER TERMS PART 1. COOKIE A cookie is a small amount of data generated by a website and saved by your web browser. Its purpose is to remember information.
CIS101 Introduction to Computing Week 06. Agenda Your questions Excel Exam during second hour Our status after the snow day Introduction to the Internet.
The Internet & The World Wide Web Notes
Internal and External Links Web Design – Section 3-6 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Computer Science : Information Systems Design and Development Unit Web Sites - National 4 / 5 St Andrew’s High School-Revised January 2013 Slide 1 St Andrew’s.
Chapter 9: Applets Jim Burns Fall Outline Learn about applets Learn about applets Write an HTML doc to host an applet Write an HTML doc to host.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
CS413: Java Programming language Applications Applets
HTML.
INTRODUCTION TO FRONTPAGE. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features Features  Starting Front Page Starting Front Page  Components.
Chapter 13Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 13 l HTML l Applets Applets and HTML.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
CPS120: Introduction to Computer Science The World Wide Web Nell Dale John Lewis.
Windows Internet Explorer 9 Chapter 1 Introduction to Internet Explorer.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
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.
Using a Template to Create a Resume and Sharing a Finished Document
Tutorial 1: Browser Basics.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2009 Pearson Education, Inc., Upper.
Chapter 17: Applets, Images, and Sound. Objectives Learn about applets Write an HTML document to host an applet Use the init() method Work with JApplet.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
1 Week 1 l HTML l Applets Applets and HTML. 2 Overview l Applets: Java programs designed to run from a document on the Internet l HTML: Hypertext Markup.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
Build it Tweak it Use it Know it Love it. A tool to collaborate on projects What does Collaborate mean? To work together.
Chapter 13Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 13 l HTML l Applets Applets and HTML.
Lec.10 + (Chapter 8 & 9) GUI Java Applet Jiang (Jen) ZHENG July 6 th, 2005.
Internal and External Links Web Design – Section 3-6 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Chapter 12Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Announcements/Reminders l Next week: »No Lectures »No Labs »Recitation.
Applets Yong Choi School of Business CSU, Bakersfield.
Java Programming Applets. Topics Write an HTML document to host an applet Understand simple applets Use Labels with simple AWT applets Write a simple.
Introduction to Computers 12/6/ BEGINNING HTML DESIGNING YOUR OWN WWW PAGES.
OLE Slide No. 1 Object Linking and Embedding H OLE H definition H add other information to documents H copy.
Internal and External Links Web Design – Section 3-6 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Chapter 131 Applets and HTML Chapter Objectives learn how to write applets learn to write a simple HTML document learn how to embed an applet in.
Applets, Images, and Audio Chapter 14 CSCI CSCI 1302 – Applets, Images, and Audio2 Outline Introduction The Applet Class –The init Method –The start.
PYP002 Intro.to Computer Science Microsoft Word1 Lab 04 - a Microsoft Windows Applications Common Features.
1 More About HTML Images and Links. 22 Objectives You will be able to Include images in your HTML page. Create links to other pages on your HTML page.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Creating Web Pages with Links, Images, and Embedded Style Sheets
1 Applets Programming. Introduction Java programs are divided into two main categories, applets and applications. An application is an ordinary Java program.
Slides prepared by Rose Williams, Binghamton University ICS201 Lecture 17 : Applets King Fahd University of Petroleum & Minerals College of Computer Science.
Chapter 14 Applets. Applets: Introduction Java programs are divided into two main categories, applets and applications An application is an ordinary Java.
Java Applets.
Using Access and the Web
COMP 101 Introduction.
COMP 101 Introduction.
Applets and HTML Chapter 13.
Chapter 13 Applets and HTML HTML Applets.
Presentation transcript:

Chapter 131 Applets and HTML Chapter 13

2 Reminders Project 8 due Dec 10:30 pm Project 6 regrades due by midnight tonight –Submit all files (including your exception classes) Nothing scheduled for CS180 next week: –No lectures –No labs –No recitations –No discussion groups

Chapter 133 Introduction Applets are simply Java programs designed to run from a document (page) on the World Wide Web. HyperText Markup Language (HTML) is the language used to create Web documents.

Chapter 134 Introduction to Applets An applet is a “small application” or a “little Java program.” Applets are Java programs that are typically displayed on a Website and viewed over the Internet. An applet can also be run as a stand-alone program on a computer which is not connected to the Internet.

Chapter 135 Applet Basics An applet is a derived class of class JApplet which is a class in the Swing library. When writing an applet, it is a good idea to include all of the following: import javax.swing.*; import java.awt.*; import java.awt.event.*;

Chapter 136 Adding Icons to an Applet An icon typically is a small picture. By placing the icon in a JLabel, the icon is displayed. A JLabel can consist of text, an icon, or both. A JButton or JMenuItem can also have an icon.

Chapter 137 Adding Icons to an Applet, cont. class DukeApplet

Chapter 138 Adding Icons to an Applet, cont.

Chapter 139 Introduction to HTML Documents to be read on the Web or using a Web browser typically are expressed in a language called HTML. HTML stands for HyperText Markup Language. Hypertext contains links (or hyperlinks) which permit you to go to other documents. Intro to HTML: t/WWW/HTMLPrimer.html

Chapter 1310 HTML Basics, cont. HTML is not case sensitive.,,, are all the same… An HTML file is a regular text file that you create and edit with a text editor. HTML files should end with.html or.htm Commands such as and form a “container” (in this case a table container).

Chapter 1311 HTML Basics, cont.

Chapter 1312 Displaying the Most Current Version of a Document While you are developing an HTML page, you can display the most recent version of the page by clicking the button labeled Reload (or perhaps Refresh). Otherwise, for efficiency, the browser may access an earlier copy of the page.

Chapter 1313 Displaying a Picture A picture can be inserted into an HTML document using example The picture can be in any directory, but the path name, either full or relative, leading to the picture must be provided.

Chapter 1314 Placing an Applet in an HTML Document To display the adder window created by class AdderApplet, place the following command in an HTML document: (Actually “.class” is optional. code=“AdderApplet” works just as well)

Chapter 1315 Placing an Applet in an HTML Document, cont. This command assumes that the HTML file and the file AdderApplet.class are in the same directory. –Otherwise, a relative or absolute path name to AdderApplet.class is needed.

Chapter 1316 Applet in an HTML Document,

Chapter 1317 Placing an Applet in an HTML Document, cont.

Chapter 1318 Using an Old Web Browser A Web browser must be set up to run applets. Web browsers do not use the same Java interpreter used to run Java applications. Older Web browsers (yours or someone else’s who may want to view your HTML document) may not be able to run applets from an HTML document.

Chapter 1319 Using an Old Web Browser, cont. Furthermore, Java updates for browsers typically lag core Java language updates. Using the older Applet class sometimes can remedy the problem. These problems do not exist if you are running applets from the applet viewer using a recent version of Java.

Chapter 1320 The Older Applet Class To use the older Applet class instead of the JApplet class –remove the J s from JApplet, JButton, JLabel, etc. (that is, use Applet, Button, Label ) –use the following import statements import java.awt.*; import java.awt.event.*; import java.applet.*;

Chapter 1321 The Older Applet Class, cont. –you do not need import javax.swing.*; –add components to the applet to itself rather than using a content pane (whatever was done to the content pane of a JApplet should be done directly to the Applet ).

Chapter 1322 The Older Applet Class, cont. –example: substitute add(friendlyLabel); for getContentPane().add(friendlyLabel); Furthermore, class Applet cannot accommodate icons easily.

Chapter 1323 Applets and Security Your applet is a program that may be run on someone else’s computer. Worse, someone else’s applet might be run on your computer! Furthermore, you don’t know that an HTML page contains an applet until you load it into your browser, and then it is too late to reject the applet; it is already stored on your computer.

Chapter 1324 Applets and Security, cont. Someone else’s program running on your computer creates serious security concerns. –Will it leave a virus? –Will it alter your files or read confidential information? –Will it corrupt your operating system? Applets cannot do any of these things (at least not easily).

Chapter 1325 Applets and Security, cont. Applets cannot run your programs, nor can they read from or write to files on your computer (unless the applet originated on your computer).

Chapter 1326 Summary You have learned how to write applets. You have learned to write a simple HTML document. You have learned how to embed an applet in an HTML document.