1 CS1110 29 Nov 2011 Applications and Applets Read Chapter 16 of the text We also look at html, since we need it to use applets. Top finalists from a real-life.

Slides:



Advertisements
Similar presentations
A magazine ran a Dilbert quotes contest. These are actual quotes from managers out there. Real-Life Dilbert Quotes.
Advertisements

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.
Lecture 15.1 Static Methods and Variables. © 2006 Pearson Addison-Wesley. All rights reserved Static Methods In Java it is possible to declare.
Java Applets A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
1 CS100J 12 April 2007 Applications and Applets Read Chapter 16 of the text I never let my schooling interfere with my education. Mark Twain Learning makes.
18-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.
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.
Chapter 14 Applets. 2 Knowledge Goals Understand the differing roles of applications and applets Understand how a browser operates Understand the role.
1 Recitation 11. Applet Applets. An applet is a Java program that is started by a browser (e.g. netscape or internet explorer) when an html file has a.
CS100Lecture 181 Announcements P4 due tomorrow P5 handed out today References? Leave me a picture and a short note.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Chapter 131 Applets and HTML Chapter Reminders Project 8 due Dec 10:30 pm Project 6 regrades due by midnight tonight –Submit all files (including.
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.
Program Design With Methods And Graphics / Chapter 4 1 Abstract Window Toolkit.
Applets, HTML and GUI’s Recitation – 04/11/2008 CS 180 Department of Computer Science, Purdue University.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
1 CS1130 Spring 2011: David Gries & Walker White Transition to Object-Oriented Programming Assumes programming knowledge in a language like Matlab, C,
Applets  The Applet Class  The HTML Tag F Passing Parameters to Applets.
Chapter 16 The World Wide Web Chapter Goals ( ) Compare and contrast the Internet and the World Wide Web Describe general Web processing.
1 Essential HTML coding By Fadi Safieddine (Week 2)
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.
1 Introduction to Applets. 2 Applications Programs that execute using the java interpreter Executes in command windows.
Putting Applets into Web Pages.  Two things are involved in the process of putting applets onto web pages ◦ The.class files of the applet ◦ The html.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
GUI programming Graphical user interface-based programming.
1 CS100J 2 December 2008 Applications and Applets Read Chapter 16 of the text We also look at html, since we need it to use applets. Top finalists from.
Nell Dale & John Lewis (adaptation by Michael Goldwasser) The World Wide Web.
Lec.10 + (Chapter 8 & 9) GUI Java Applet Jiang (Jen) ZHENG July 6 th, 2005.
1 Recitation 09. Applications and Applets Java applications Those who took CS100J and CS100M in fall 2003 may not have had much experience with Java applications.
CSC 205 – Java Programming II Applet. Types of Java Programs Applets Applications Console applications Graphics applications Applications are stand-alone.
Chapter 6 Applets and HTML  Overview  HTML tags for Applets  Applet Life Cycle  Applet Class  JAR files.
Lecture 15.1 Static Methods and Variables Static Methods In Java it is possible to declare methods and variables to belong to a class rather than.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Chapter 29 World Wide Web & Browsing World Wide Web (WWW) is a distributed hypermedia (hypertext & graphics) on-line repository of information that users.
1 Interfaces Sec contains this material. Corresponding lectures on ProgramLive CD is an alternative way to learn the material. Top finalists from.
Chapter 4 Applets Cop Why Applets? WWW makes huge information available to anyone with web browser. Web server send web pages and images to your.
Introduction to Computers 12/6/ BEGINNING HTML DESIGNING YOUR OWN WWW PAGES.
1 GUI programming Graphical user interface-based programming Chapter G1 (pages )
1 CS November Testing/Debugging. And Applications Read chapter 14, pp. 385–401 Prelim 2 Max 100 Median 82 Mean 78.3 Min * ***************************
Applets. Internet/WWW How does it work? Internet/WWW.
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.
1 Applications & Applets Standalone applications & Java applets Peter Mozelius DSV/UCSC.
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.
Web programming Part 1: HTML 由 NordriDesign 提供
CSC 243 – Java Programming, Spring, 2014 April 22, 2014 Week 13, JApplets.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
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.
Basic HTML Programming Technology Education Ellsworth Community Middle School Communication Systems.
1 CS100J 08 November 2005: Applications and Applets Java application; How to produce a stand-alone application, to be run without using DrJava or any such.
Georgia Institute of Technology Making Text for the Web part 2 Barb Ericson Georgia Institute of Technology March 2006.
Week-11 (Lecture-1) Introduction to HTML programming: A web based markup language for web. Ex.
Web Basics: HTML/CSS/JavaScript What are they?
Introduction to HTML:.
We also look at html, since we need it to use applets.
We also look at html, since we need it to use applets.
30 Java Applets.
HTML HYPERTEXT MARKUP LANGUAGE.
Basic HTML and Embed Codes
Applets.
CS November 2010 Ragged arrays, Applets
Chapter 16 The World Wide Web.
We also look at html, since we need it to use applets.
Outline Character Strings Variables and Assignment
JAVA APPLET PREPARED BY Mr. Jahanzaib Ahmed
CS100J 03 May 2005 Applications and Applets (Chapter 16 of the text)
Presentation transcript:

1 CS Nov 2011 Applications and Applets Read Chapter 16 of the text We also look at html, since we need it to use applets. Top finalists from a real-life “Dilbert quotes contest” As of tomorrow, employees will be able to access the building only using individual security cards. Pictures will be taken next Wednesday and employ- ees will receive their cards in two weeks." (Fred Dales, Microsoft) I need an exact list of specific unknown problems we might encounter. (Lykes Lines Shipping) is not to be used to pass on information or data. It should be used only for company business. (Accounting manager, Electric Boat Company) This project is so important, we can't let things that are more important interfere with it. (Advertising/Marketing manager, United Parcel Service) Doing it right is no excuse for not meeting the schedule. (Plant manager, Delco Corporation)

Online course evaluations 2 You will be (or have been) sent an asking you to fill out course evaluations. Between now and just before finals begin. Your course evaluations are important. We use them in trying to improve the course. Completing the course evaluation is a requirement. It counts as much as a quiz. AFTER the submission period for course evaluations are over, we receive a list of students who completed it and upload the info to the CMS. We do NOT receive the actual evaluations until after we submit the grades for the course. They are delivered to us in anonymous fashion. We do not know who said what.

3 Executing Java programs outside the DrJava Interactions pane. Every Java program is either an application or an applet. public class C { … public static void main(String[] args) { … } … } A Java application needs a class with a method main that is defined like this. To start the application, method main is called. The parameter, an array of Strings, can be used to pass information into the program.

4 public class CLAS { … public static void main(String[] args) { … } … } > cd > dir (list of files) > java CLAS Terminal window (can type “java CLAS” in DrJava Interactions pane) Causes method call CLAS.main(null); to be executed

5 jar file (Java Archive file) (like tar file (Tape Archive file)) Contains (among other things) (1).class files (2)a “manifest”, which says which class has method main Manifest: A list of passengers or an invoice of cargo for a vehicle (as a ship or plane).

6 Standalone Java programs Suppose images.jar contains a Java application It has a class with a static procedure main, and its manifest names the class. Execute it by double clicking its icon in a directory. Execute it by typing java -jar images.jar in a terminal window (or DOS, or command-line window)

7 Creating a jar file 1.Navigate to the directory that contains the.class files. 2.Create a text file x.mf that contains one line (with a line-feed): Main-class: 3.In the directory, type: jar -cmf x.mf app.jar *.class Create Manifest File name of manifest file name of file to create expands to name all the.class files

8 Inspecting jar files jar -tf images.jar type (list) File name of jar file List the contents of jar file images.jar

9 Applet: a java program that can be called from a web page (in your browser) public class C { public static void main(String[] args) { … } } application import javax.swing.*; public class A extends JApplet { public void init() { … } public void start() { …} public void stop() { … } public void destroy() { … } } applet Four inherited procedures: called to initialize called to start processing called to stop processing called to destroy resources (just before killing the applet)

Quizit is both an applet and an application 10 public class Quizit extends JApplet { // = “started as an applet” private boolean isApplet= false; public Quizit() {} /** = “started as an applet” */ public boolean isApplet() { return isApplet; } public static void main( String[] pars) { Quizit a= new Quizit(); a.isApplet= false; … a.readTopicsFile(br); a.gui= new A7GUI( a.fillItems(), a); } /** initialize applet */ public void init() { isApplet= true; … readTopicsFile(br); gui= new A7GUI( fillItems(), this); }

11 tags An html (HyperText Markup Language) file Just a title Demo Links and Images This is a link This <a href=" target="_blank">link opens a new window Below is an image <img src="Hilbert_curve.png" width="544” height="352"> start an html page start the “heading” the title for the page start the body, content, of the page begin a paragraph begin a link begin an image

12 An html (HyperText Markup Language) file FacultyApplet This is an Applet! <applet archive="AppletClasses.jar” code="FacultyApplet.class” width=800 height=550> tags start an html page start the “heading” the title for the page start the body, content, of the page begin a paragraph begin boldface begin italics start a Java applet line break (no end tag)