COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 35 – Overview of Java Web Programming Webpage: www.cise.ufl.edu/~mssz/JavaNM/Top-Level.html.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

In Review JAVA C++ GUIs - Windows Webopedia.com.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 32 – Java Graphical User Interfaces (GUIs) Webpage:
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 09 – Programming with Java Datatypes and Flow Control.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Java Applet & JavaScript SNU OOPSLA Lab. October 2005.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
OOP & JAVA. HelloWorld.java /** * The HelloWorld class is an application that * displays "Hello World!" to the standard output. */ public class HelloWorld.
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.
Java Quick & Dirty By Bert Wachsmuth. Overview  We will cover: What is Java Using and Writing Java applets Getting more information  We will need: Knowledge.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Getting Started What is Java? A programming language –Fully buzzword-compliant: A simple, object oriented, distributed, interpreted, robust, secure,
1 CSC 551: Web Programming Spring 2004 Java Overview  Design goals & features  platform independence, portable, secure, simple, object-oriented, … 
Client/Server Architectures
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 1
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.
Applets & Servlets.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
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
Computer Programming 12 Mr. Jean March 19 th, 2013.
Java Applet Presented by: Feng Liu. Agenda Introduction Java Applet vs. JavaScript Steps in Creating a Java Applet Java Applet Example Do I have to write.
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.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
POS 406 Java Technology And Beginning Java Code
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Introduction to Applets Course Lecture Slides 29 th July 2010.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 10 – Programming with Java Datatypes Type Casting.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
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.
Program that runs in appletviewer (test utility for applets) Web browser (IE, Communicator) Executes when HTML (Hypertext Markup Language) document containing.
Java applets. Outline What is Java? Java Applications Java Applets Java Applets Securities Summary.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 11 – How to Get Started on Assignment #2 Webpage:
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 20 – Inheritance and Polymorphism in Java Webpage:
CHAPTER Agenda Applets Servelets Browsers HelloWorld.
CSCI 212 Object-Oriented Programming in Java. Prerequisite: CSCI 111 variable assignment statement while loop for loop post-increment (i++) strong typing.
1 Java Applet Basics Chapter Eight. 2 Applets vs. Applications l Applications: Stand alone Java programs run by interpreter l Applets WWW browser embedded.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 06 – Java Datatypes Webpage:
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 39 – Command Line Args & Recursion Webpage:
ITP 109 Week 2 Trina Gregory Introduction to Java.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 14 – How to Complete Assignment 2, Part III Webpage:
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 08 – Hand-On Work: Assignment 1, Part III Webpage:
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
A Programming Language for Web-based Computing with Graphics
COP2800 – Computer Programming Using JAVA
Distributed Computing, M. L. Liu
Distributed Computing, M. L. Liu
Java Applets.
Introduction to Applet, Application and JDK
Java applets 1/3/2019.
A Programming Language for
CSC 551: Web Programming Spring 2004
CSC 551: Web Programming Spring 2004
Java Programming COMP-417 Applet
Handout-14 Applets and Graphics
JAVA APPLET PREPARED BY Mr. Jahanzaib Ahmed
G6DICP - Lecture 27 Java Applets.
A Programming Language for
Presentation transcript:

COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 35 – Overview of Java Web Programming Webpage:

COP2800 – Programming in JAVA Course Objectives – Basic Knowledge of Computers & Programming – Specific Knowledge of JAVA Programming – Practical Programming Projects Build Skills Today’s Class – Overview of Java for the Web – Java Design for a Simple Applet Making the Components Integrating Components into an Applet

Review: Java Program Structure HIGH-LEVEL VIEW JAVA Units: -Packages -Classes (Instances) -Methods -Instructions -Variables PICTURE CREDIT:

Review: Java Package Structure PICTURE CREDIT:

How Does Java Work with Web? Three Principal Technologies: 1.JavaScript 2.Java Servlet 3.Java Applet A Java applet is a program delivered to users as Java bytecode (platform independent). Java applets can be executed by browsers for many platforms, including Microsoft Windows, Unix, OS X and Linux.Java bytecodeMicrosoft WindowsUnixOS XLinux Source:

Java Working with Web (cont’d) Image Credit: sandriabudiendra.blogspot.com APPLET ARCHITECTURE OF AN APPLET

Java Working with Web (cont’d) Advantages of Applets: It is simple to make it work Applets are supported by most Web browsers Execution can be fast Computational work can be moved from server to client Increased scalability with number of users and clients Some Disadvantages of Applets: Requires Java plug-in Some browsers, notably mobile browsers running Apple iOS or Android do not run Java applets at all Apple iOSAndroid Security and access restrictions may forbid applets If a Java Runtime Environment is needed, download time may be quite long (depending on bandwidth & version)

Example: Hello World Applet Step 1. Create Java Code for “Hello World” Applet import java.applet.Applet; import java.awt.Graphics; public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); } Step 2. Compile the file HelloWorld.java Compiler creates HelloWorld.class in the same directory (folder) as the Java source file (HelloWorld.java).

Ex: Hello World Applet (cont’d) Step 3. Create HTML file named Hello.htmlHello.html with the following text, in the same directory that contains HelloWorld.class : HelloWorld Program Here is the output of my program:

Ex: Hello World Applet (cont’d) Step 4. Run the “Hello World” Applet: Load Hello.html into an application that runs Java applets: Java-compatible browser URL = file:/home/username/HTML/Hello.html Java applet viewing program Applet Viewer in JDK The browser window will show a message similar to this: Here is the output of my program: Hello world!

How We will Use Applets Assignment 6: Given IntelligentTTT Game and GUI Code (from Assignments 4 and 5 – work in groups) Make a Java Applet Run the Java Applet on a Web Browser - All the Features of Assignment 5 - We will help you with GUI and applet code … and more …

This Week: More GUIs, New Applets Wednesday 17 Apr 2013: GUIs and Applets in JAVA – Assignment #6 Approach, Code, and Analysis Friday 19 Apr 2013: Assignment #6 Hands-On Experience Coding Examples (LAPTOPS)