CSE 373 -- S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.

Slides:



Advertisements
Similar presentations
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Advertisements

Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Introduction to JAVA Vijayan Sugumaran School of Business Administration Oakland University Rochester, MI
Object Oriented Programming in Java George Mason University Fall 2011
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;
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
Principles of Object-Oriented Software Development The language Java.
Using Java without BlueJ Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling BlueJ projects A BlueJ.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Introduction to Java.
PHY281Introduction to JavaSlide 1 Introduction to Java In this section we will learn how how to use Java and write our first Java Applet:  The Java Development.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
Developing User Interfaces (DUI) Chris North cs3724: HCI.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
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.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CS413: Java Programming language Applications Applets
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
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.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
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.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
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.
JAVA Java is a programming language and computing platform first released by Sun Microsystems in It was first developed by James Gosling at Sun Microsystems,
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.
POS 406 Java Technology And Beginning Java Code
1 Programming Fundamentals AITI-GP. 2 Introduction to Programming.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Fundamentals of Web Publishing MIS 208-B LEC: T 08:15PM-10:05PM- ADM102 LAB: TH 08:15PM-10:05PM - ADM138 Andy Stokes.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
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.
Object Oriented Programming Lecture 3. Introduction  In discussing Java, some items need to be clarified  The Java programming language  The Java virtual.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 35 – Overview of Java Web Programming Webpage:
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
Applets Yong Choi School of Business CSU, Bakersfield.
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.
CS 4244: Internet Programming Network Programming in Java 1.0.
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.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of.
Your name CSCI/CMPE 3326 Object-Oriented Programming in Java Dongchul Kim Department of Computer Science University of Texas – Pan American 1.Applet.
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.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
Applications Active Web Documents Active Web Documents.
A Programming Language for Web-based Computing with Graphics
Chapter Two Applet vs. Application
Introduction to Java Dept. Business Computing University of Winnipeg
Java Applets.
A Programming Language for
F II 1. Background Objectives
Chap 1. Getting Started Objectives
Review of Previous Lesson
JAVA APPLET PREPARED BY Mr. Jahanzaib Ahmed
A Programming Language for
A Brief History January 1996: first official release JDK 1.0
Presentation transcript:

CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics

CSE S. Tanimoto Java Introduction 2 Language Features of Java -- Garbage-collected -- Support for Object-oriented programming -- Support for packages -- Compiles to intermediate code -- Intermediate code is then interpreted -- Built-in support for many data structures such as hash tables, vectors

CSE S. Tanimoto Java Introduction 3 Applets vs CGI Differences: Java supports client-side processing in Web via “Applets” HTTP GET/POST Web page Apache W.S. CGI program Browser HTTP GET Java class files Apache W.S. Browser/JVM Applet Exec. Client Side Server Side

CSE S. Tanimoto Java Introduction 4 More Features of Java More Differences: Security considerations, because of its web orientation: compulsory “try” and “catch” error handling. Stronger typing of variables than in, say, Lisp. Standard graphics API’s: the AWT and Swing.

CSE S. Tanimoto Java Introduction 5 Influences on Java C, C++: syntax of arithmetic and boolean expressions, need for safe pointer operations. Smalltalk, C++, CLOS: Object orientation Lisp: garbage collection, “bignums”

CSE S. Tanimoto Java Introduction 6 Java’s Web Support Applets: Java virtual machine can run in a browser. Safe pointers avoid segmentation faults and other dangerous errors. Security manager provides that applets don’t perform I/O to client hard disk. Applets permitted only limited upload communication (to the originating server). Standard networking package is provided.

CSE S. Tanimoto Java Introduction 7 Java’s Graphics AWT: The Abstract Windowing Toolkit is a package providing standard classes for building GUIs. Support for decoding GIF and JPEG image formats is built in. Java has used two slightly different event models for user interaction: JDK 1.0 (old) and JDK 1.1 (new). Java2D is a more advanced imaging package that’s made to work with Java 2.

CSE S. Tanimoto Java Introduction 8 Java’s Threads Java programs can contain multiple threads of control. This can permit parallel processing. This can permit logical separation of the program into code for concurrent processes. Threads are especially useful in animation within an applet. Run-time scheduling of threads is not completely platform independent.

CSE S. Tanimoto Java Introduction 9 Example Application class MyFirstApplication { public static void main(String[] args) { System.out.println("Hello CSE 373"); } To compile on a Unix system, type: javac MyFirstApplication.java Then to run it, type: java MyFirstApplication

CSE S. Tanimoto Java Introduction 10 Example Applet import java.applet.Applet; import java.awt.Graphics; public class MyFirstApplet extends Applet { public void paint(Graphics g) { g.drawString("Hello CSE 373!", 50, 25); } To compile on a Unix system, type: javac MyFirstApplet.java Then to run it, embed a reference to it in a web page...

CSE S. Tanimoto Java Introduction 11 Web Page with Applet Tag A Simple Program So here is my first applet: <APPLET CODE=”MyFirstApplet.class” WIDTH=150 HEIGHT=25>

CSE S. Tanimoto Java Introduction 12 Logistics of Getting Started With Java Choose a place to work: Math Sciences Computer Center may be best. (It’s CSE 373’s designated lab) If you need to, download and install JDK using the link on our syllabus page. Create a folder for your Java project. Choose a text editor to use for editing your source code, e.g., Word, saving as Text File. Name each of your Java source files using the name of your public class. Under Windows, create files compile.bat and run.bat to “automate” steps in your edit/compile/run cycle.

CSE S. Tanimoto Java Introduction 13 Troubleshooting your Java Setup Make sure you use the correct paths to the Java compiler and Java runtime executable. The compiler expects source files to end in.java and requires that the extension be given in the command: C:\jdk1.1.8\bin javac MyApplication.java The Runtime executable requires that you have a.class file to run, and that it is an application, not an applet. C:\jdk1.1.8\bin java MyApplication You don’t type the.class extension here. The source file name must match the name of the public class defined in the file. Capitalization matters. Don’t get it wrong.

CSE S. Tanimoto Java Introduction 14 One Setup for Java Applet Development Create a simple web page (HTML file) and put it in the same folder as your applet. Start up Netscape Navigator or I.E., and bookmark this page. Practise “reloading” the page and the Java applet with your browser. In Netscape, you hold the shift key and click on Reload, which forces the applet to be reloaded as well as the text of the page. Otherwise you will keep getting the (cached) old version of your applet even after updating your.class files. You may wish to open another browser window and bring up the Java documentation in that window, keeping it open while you are developing. When your applet is completely finished, then you may wish to transfer it and your web page to Dante and publish it on the web. At point, be careful about where you put each file, and the permissions on the files and the folders they are in. Always test your applets on the web before submitting them for grading.