25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 1 Class 9 - HTML r Creating a personal web page r Structure of HTML documents r HTML tags r The APPLET.

Slides:



Advertisements
Similar presentations
Computers: Tools for an Information Age Writing Your Own Web Page: Using HTML and Web Authoring Tools.
Advertisements

HTML popo.
HTML. The World Wide Web Protocols Addresses HTML.
HTML: HyperText Markup Language Hello World Welcome to the world!
Chapter 2 HTML Basics Key Concepts
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
HTML Minute University Richard Fisher 10/1/2001 HTML FSA Training2 HTML Overview  HTML  HyperText Markup Language.
Introduction to HTML Lists, Images, and Links. Before We Begin Save another file in Notepad Save another file in Notepad Open your HTML, then do File>Save.
HTML Programming last updated 9/12/05 at 1:30pm HyperText Markup Language Reference: – HTML BasicsHTML Basics An HTML program is a set of paired tags that.
Java Applets A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
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.
CS /13 DePaul University SNL 262 Advanced Web Page Design Review & Introduction - I Instructor: David A. Lash.
Computer Science 1611 Internet & Web Creating Webpages Hypertext and the HTML Markup Language.
Web Page Development Identify elements of a Web Page Start Notepad
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Applets and Graphics.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
MA10126 Introduction to HTML Gavin Shaddick
Creating a Web Page HyperText Markup Language. HTML Documents  Created using any text editor  Notepad  Vi, Pico, or Emacs  If using word-processor,
HTML Lesson 1 TBE 540 Farah Fisher. Prerequisites Before beginning this lesson, the student must be able to… Access web pages and navigate the web Access.
Designing Web Pages Getting to know HTML... What is HTML? Hyper Text Markup Language HTML is the major language of the Internet’s World Wide Web. Web.
©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.
1 Outline 3.1 Introduction 3.2 Editing HTML 3.3 First HTML Example 3.4 W3C HTML Validation Service 3.5 Headers 3.6 Linking 3.7 Images 3.8 Special Characters.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
HTML HTML stands for "Hyper Text Mark-up Language“. Technically, HTML is not a programming language, but rather a markup language. Used to create web pages.
HTML (HyperText Markup Language)
.  Entertain  Inform  Educate  Blogs  Sell  Date  Gamble  Religion.
Images Inserting an image on a web page. chcslonline.org2 ITEMS REQUIRED Go to the course download page on the course website and download the 3 images.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 2 HTML TAGS G H E F.
XP Mohammad Moizuddin Creating Web Pages with HTML Tutorial 1 1 New Perspectives on Creating Web Pages With HTML Tutorial 1: Developing a Basic Web Page.
Html Basic Codes Week Two. Start Your Text Editor Windows use 'Notepad’ Macintosh use 'Simple Text'
Welcome to CMPE003 Personal Computer Concepts: Hardware and Software Winter 2003 UC Santa Cruz Instructor: Guy Cox.
Programming in HTML.  Programming Language  Used to design/create web pages  Hyper Text Markup Language  Markup Language  Series of Markup tags 
Java On The Web Session 15. Memory Upload JAVA Applets Colors Fonts Drawing Methods Posting your Applet.
Introduction to HTML. What is a HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup tags  The.
Learn about the types of Graphics that are available Develop a basic Graphics applet Develop a basic Graphics application Review the Java API and use.
Just Enough HTML How to Create Basic HTML Documents.
HTML,DHTML & Javascript/Session1/1 of 39 Introduction and Basic Tags Session 1 of Using HTML, DHTML & JavaScript.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
User-defined parameters can be passed to an applet using the tags.
1 John Magee 9 November 2012 CS120 Lecture 17: The World Wide Web and HTML Web Publishing.
J McQuillan SE204: 2004/2005: Lecture 4slide 1 The Graphics Class Used when we need to draw to the screen Two graphics classes –Graphics –Graphics2D.
1 CSC Computer Education (P) Ltd. DESIGNED BY K PRAKASH,
Lec.10 + (Chapter 8 & 9) GUI Java Applet Jiang (Jen) ZHENG July 6 th, 2005.
Chapter 2 Designing Web Pages With HTML JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin,
HTML: Images and Links Many Thanks to “Joe,” at index.html, from whom I got these lessons!
Introduction to Computers 12/6/ BEGINNING HTML DESIGNING YOUR OWN WWW PAGES.
2/5/00SEM107 © Kamin & Reddy Review -1 Class 19 - Review r This lecture contains a selection of slides from previous lectures, giving the “high points”
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 2 and 3 Scott Marino.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Web programming Part 1: HTML 由 NordriDesign 提供
Writing Your Own Web Page: Using HTML and FrontPage Chapter 10.
REEM ALMOTIRI Information Technology Department Majmaah University.
`. Lecture Overview HTML Body Elements Linking techniques HyperText references Linking images Linking to locations on a page Linking to a fragment on.
HTML. INDEX Introduction to HTML Creating Web Pages Commands And Tags Web Page.
Lec 15 Writing an Applet Class. Agenda Writing an Applet class Java Graphics class.
Chapter 4 HTML Tags. HTML is written in something called tags. Tags come in pairs, an opening one and a closing one. The first pair of tags we'll write.
Basic Web Publishing M. Scott Gartner 7/15/98.
Introduction to HTML.
Chapter 8 Introduction to HTML and Applets
HTML Basics.
Basic HTML and Embed Codes
Introduction to HTML.
Project 4 Creating an Image Map.
MA10126 Introduction to HTML
Presentation transcript:

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 1 Class 9 - HTML r Creating a personal web page r Structure of HTML documents r HTML tags r The APPLET tag

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 2 HTML r Web pages are text documents with special formatting commands, called tags. r The formatting language is called HTML. r Can view raw HTML by selecting “view source” in browser.

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 3 Creating a personal web page  Use text editor to create file index.html containing HTML document  Place in public_html directory under your home directory. r Set permission correctly; -rw-r--r-- 1 udr... Feb 22 16:57 index.html see “web publishing” link for details.  URL for your page is /~ yournetid

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 4 Overview of HTML r HTML documents are text documents, i.e. created with text editor (like Java programs) r Contain text and tags:... text... E.g. Read this now ! would show up as: Read this now! r HTML is mostly free-form (lines breaks not significant)

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 5 Structure of HTML documents... stuff lots of stuff... title of browser window contents of browser window

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 6 Structure of HTML documents (cont.) r “Stuff” consists of text and tags r Matching tag pairs are nested, like braces or parentheses in programs Big title When in the course of... Four score and seven... “Level 1 heading” - displays in large font “Paragraph” tag leaves space - matching is optional

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 7 The and tags ,..., : set text in larger fonts for section headings m H1 is largest heading, H6 smallest m Matching tags should be included  : leave space, i.e. start a new paragraph m Matching tag optional (usually omitted)

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 8 Links Links created using tags with HREF attribute: E.g. text highlighted in browser - click to follow link My favorite class is SEM107 !

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 9 Images  In-line GIF and JPEG images included using IMG tag, with SRC attribute. (Matching tag usually omitted.)... text to be set off by blue lines... images can be stored in sub- directory

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 10 HTML Resources r Lots of books on HTML r On-line tutorials. (E.g. in Yahoo, search for “beginner’s html”) r Use “view source” in browsers r Obtaining graphics m “Download image to disk” in browser  Free graphics from many sites, e.g.

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 11 Applets  Applets are Java programs. Compile to create.class files. r Applets have a special form, and use parts of the API we have not used before.  Include in HTML document using APPLET tag.

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 12 The APPLET tag  Place all class files in a subdirectory, say appletcode. <APPLET CODE=“ appletname.class” CODEBASE=“appletcode” HEIGHT = 400 WIDTH = 300> mandatory stuff in here will be displayed if browser is not Java-equipped

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 13 Simple applet example We will discuss applets in detail in upcoming classes. This example is included just to show how the pieces fit together, not to show how to program applets. r Example is a simple HTML page containing a simple applet to draw a red circle r Suppose this belongs to a student whose netid is superman.

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 14 Simple applet example (cont.)  File Redcircle.java : Redcircle.class is placed in appletcode directory. import java.awt.*; import java.applet.*; public class Redcircle extends Applet { public void paint (Graphics g) { g.setColor(Color.red); g.drawOval(0,0,50,50); }

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 15 Simple applet example (cont.)  File index.html : Superman Applets: Well, really just one applet: <APPLET CODE="Redcircle.class" CODEBASE="appletcode" WIDTH=55 HEIGHT=55> Hope you liked it!

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 16 Simple applet example (cont.)  index.html placed in public_html (with correct permissions).  Accessing from anywhere yields:

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 17 Simple applet example (cont.)

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 18 Writing applets The general form of an applet is: import java.applet.*; import java.awt.*; public class appletname extends Applet { public void init () {... } public void paint (Graphics g) {... }... other methods... } Usually present

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 19 init and paint methods Most applets have these two methods (at least):  init initializes instance variables (see below).  paint performs graphics operations to draw shapes in the applet’s window r Called when applet is first displayed, and whenever it is re-displayed.  The Graphics objects is used to do the drawing

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 20 The graphics coordinate system r Keep in mind that the graphics coordinate system is “upside-down” - the lower the location on the screen, the higher the y value. The upper left corner is (0,0). r The applet window is of limited size. Anything drawn outside of it will simply be clipped (without warning).

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 21 Drawing operations The Graphics class defines numerous instance methods:  drawLine(int x0, int y0, int x1, int y1) - draw a line from (x0,y0) to (x1,y1)  drawRect(int x0, int y0, int width, int height) - draw a width x height box, with upper left corner at (x0,y0)  fillRect(int x0, int y0, int width, int height) - same as drawRect, but filled

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 22 Drawing operations (cont.)  drawOval(int x0, int y0, int width, int height) - draw an oval inscribed in the rectangle described above  fillOval(int x0, int y0, int width, int height) - similarly  drawString(String s, int x0, int y0) - draw s with its bottom-left corner at (x0,y0)

25/2/00SEM107 - © Kamin & ReddyClass 9 - HTML - 23 Example: drawing a LineList r When the paint method is called with a Graphics object, it can call other methods. The Graphics object can be used to draw in the applet window. r Draw a LineList in a Graphics object: static void drawLineList (LineList L, Graphics g) { if (!L.empty()) { Line ln = L.hd(); g.drawLine(ln.x0(), ln.y0(), ln.x1(), ln.y1()); drawLineList(L.tl(), g); }