Developing User Interfaces (DUI) Chris North cs3724: HCI.

Slides:



Advertisements
Similar presentations
Made with love, by Zachary Langley Applets The Graphics Presentation.
Advertisements

Java Applets:. How Applets differ from application?: They do not use main method but init(), start() and paint() methods of the applet class They can.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Programming and Problem Solving With Java Copyright 1999, James M. Slack Applets What is an Applet? Applet Parameters Graphics in Applets Other Applet.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Lecture 24 Applets. Introduction to Applets Applets should NOT have main method but rather init, stop, paint etc They should be run through javac compiler.
Review of Java Applets Vijayan Sugumaran Decision and Information Sciences Oakland University.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 16 Applets.
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.
Principles of Object-Oriented Software Development The language Java.
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.
Applets. What is an Applet?  According to Sun “An applet is a small program that is intended not to be run on its own, but rather to be embedded inside.
Java Swing Chris North cs3724: HCI. AWT to Swing AWT: Abstract Windowing Toolkit import java.awt.* Swing: new with Java2 import javax.swing.* Extends.
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.
EE2E1. JAVA Programming Introduction Dr. Mike Spann
Introduction to Java Programming CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University.
Introduction to Java Programming CS 21a: Introduction to Computing I First Semester,
Applets  The Applet Class  The HTML Tag F Passing Parameters to Applets.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
19-Sep-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic : Applets Maj Joel Young
Intro to Java 2 By Geb Thomas Based on the Java TutorialJava Tutorial.
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.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
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.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
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.
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.
An Introduction to Software Development Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006.
Java Intro Chris North cs3724: HCI. Presentations john randal, tom shultz Vote: UI Hall of Fame/Shame?
C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A.
Applets. What is an applet? Why create applets instead of applications? – Applets are Java programs that can be embedded in an HTML document – In contrast,
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.
Java applets. Outline What is Java? Java Applications Java Applets Java Applets Securities Summary.
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.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
Applets and Frames. Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L14: GUI Slide 2 Applets Usually.
Applets Yong Choi School of Business CSU, Bakersfield.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of.
1 Applets are small applications that are accessed on an Internet server, transported over the internet, automatically installed and run as a part of web.
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.
Applets, Images, and Audio Chapter 14 CSCI CSCI 1302 – Applets, Images, and Audio2 Outline Introduction The Applet Class –The init Method –The start.
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.
User Interface Programming in C#: Basics and Events Chris North CS 3724: HCI.
Applets. 9/04/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L12: Applets Slide 2 Applets Usually.
1 Applets Programming. Introduction Java programs are divided into two main categories, applets and applications. An application is an ordinary Java program.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Java Applet What is a Java Applet? How is applet compiled?
Applications Active Web Documents Active Web Documents.
A Programming Language for Web-based Computing with Graphics
Lecture 09 Applets.
30 Java Applets.
Applets.
UNIT-5.
A Programming Language for
Chap 1. Getting Started Objectives
JAVA APPLET PREPARED BY Mr. Jahanzaib Ahmed
A Programming Language for
A Brief History January 1996: first official release JDK 1.0
Presentation transcript:

Developing User Interfaces (DUI) Chris North cs3724: HCI

GUI Development: Goals 1.Learn general GUI programming concepts GUI components Layout Event-based programming Graphics Animation 2.Learn Java Swing Layout managers Listerners 2D graphics Threads Then: can learn other languages quickly VB, C#, Xwin, Java 49

Intro to Java

Why Java?

Java materials Java 2 = sdk 1.2 or better Documentation: Tutorials, reference, API Borland JBuilder 6 Free! Cross between VB and VC++

Java differences Basic statements identical to C++ Object-oriented only! No.h files main() is inside a class No global variables No pointers (object references only) No delete: automatic garbage collection Single inheritance only, “interfaces” Applet/application GUI: AWT, Swing Packaging Error Handling, exceptions (try, catch) E.g. Array bounds checking Security Components: beans

Java compiling Code: hello.java (text file) Compile: javac hello.java Creates: hello.class(byte code) Run: java hello Java virtual machine, interpets/compiles (machine code) Packaging: jar Or use JBuilder, like VC++

Java Applications Run from command line hello.java: class hello { public static void main(String[] args){ System.out.println(“Hello World!”); } javac hello.java java hello Hello World!

Typically create objects hello.java: class hello { public static void main(String[] args){ // Create and use objects hello h = new hello(); … } public hello(){ // Constructor … } … }

Many Classes Compile each separately Can be main( ) in any/all classes hello.java: class hello { goodbye g; public static void main(String[] args){ … } goodbye.java: class goodbye { public static void main(String[] args){ … }

Hmmm… dir hello.class goodbye.class blah.class foo.class bar.class areyouawakein.class Java ??? RunMe.bat: java hello

JBuilder

Java Applets Run in a web browser hello.java: import javax.swing.*; class hello extends JApplet { public void init(){ getContentPane().add( new JLabel(“Hello World!”) ); } javac hello.java appletviewer hello Hello World!

Java Applets in HTML hello.html: <applet code=“hello.class” height=100 width=200> Need java. Put hello.html and hello.class on website Java plug-in Hello World! hello.html

Applet Methods init( ) - initialization start( ) - resume processing (e.g. animations) stop( )- pause destroy( )- cleanup paint( )- redraw stuff (‘expose’ event)

Applet Security No read/write on client machine Can’t execute programs on client machine Communicate only with server “Java applet window” Warning Certificates

Upcoming Java Topics GUIs: Swing, AWT, MVC Event handling, listeners Graphics Animation, threads Components, JavaBeans Databases, JDBC