How to Convert an Application into an Applet.

Size: px
Start display at page:

Download "How to Convert an Application into an Applet."

Transcription

1 How to Convert an Application into an Applet. A java application contains a main method. An applet is a java program part of a web page and runs within a browser. I am going to show you three different examples. All of them involve converting a program with a GUI into an applet. Example 1. Original Program Contains a JFrame. This is a program that we used in Unit 10. Run_Ex1.java Ex1_Panel.java public class Run_Ex1 { public static void main( String [] args ) { JFrame f = new JFrame(); f.settitle( "Example" ); f.setsize( 300, 100 ); f.setdefaultcloseoperation( JFrame. EXIT_ON_CLOSE ); Container pane = f.getcontentpane(); pane.setlayout( new BorderLayout() ); Ex1_Panel p = new Ex1_Panel (); pane.add( p, BorderLayout.CENTER ); f.setvisible( true ); public class Ex1_Panel extends JPanel { private JTextField txt = new JTextField(); private JLabel lblresponse = new JLabel(); public Ex1_Panel() { setbackground( Color.ORANGE ); setlayout( new GridLayout( 2, 2 ) ); JLabel lbl = new JLabel("Enter an integer: "); JButton btn = new JButton( "Click Here" ); btn.addactionlistener( new Bob() ); add( lbl ); add( txt ); add( btn ); add( lblresponse ); private class Bob implements ActionListener { public void actionperformed( ActionEvent e) { String str = txt.gettext(); int num = Integer.parseInt( str ); if ( num % 2 == 0 ) lblresponse.settext("even"); else lblresponse.settext("odd"); Step 1. Create a project in DrJava. Copy Ex1_Panel.java into the project. Copy Run_Ex1.java into the project but rename it Run_App1.java and make the changes shown on the next page.

2 Run_Ex1.java Run_App1.java Hey! Look at this! public class Run_Ex1 { public static void main( String [] args ) { JFrame f = new JFrame(); f.settitle( "Example" ); f.setsize( 300, 100 ); f.setdefaultcloseoperation( JFrame. EXIT_ON_CLOSE ); public class Run_App1 extends JApplet{ public void init(){ /* no, you don t have to leave these lines blank. I wanted to emphasize the lines that are no longer needed because applets do not use JFrames. */ Container pane = f.getcontentpane(); pane.setlayout( new BorderLayout() ); Ex1_Panel p = new Ex1_Panel (); pane.add( p, BorderLayout.CENTER ); f.setvisible( true ); Container pane = getcontentpane(); pane.setlayout( new BorderLayout() ); Ex1_Panel p = new Ex1_Panel (); pane.add( p, BorderLayout.CENTER ); General rules for converting application code into applet code. You need a class that extends JApplet. This has a getcontentpane method (just like JFrame). Do not write a constructor for the class that extends JApplet. On the other hand, you must override the init method. This basically serves as our main method (which we do not use.) Do not use the JFrame class. Step 2. You create a jar file that contains compressed copies of your files. It makes for faster downloads. You can easily do this in DrJava if you are in a project. Click on the Project menu and then select Create Jar File from Project Select Jar All Files though it may work to select Jar classes. Name the Jar file Run_App1.jar and click OK. Step 3. You write an html file that displays the applet. Open Notepad or Wordpad and enter the following: <html><head><title>example 1 Applet</title></head><body> <h1>example 1</h1> <applet code = "Run_App1.class" archive = "Run_App1.jar" width = "300" height= "100" > </applet> </body></html> Save it as Ex1.html. Double-click on this file and your program should display (and work) within the web page. This is valid html from around Times change but I think this is good enough. Feel free to disagree with me.

3 Example 2. Original Program Contains a Class that Extends JFrame. This program has contains two panels. If you click on the left or right panel, num increases by one and both messages display the new value. This is a simple runner class. public class Run_Ex2 { public static void main( String [] args ) { MyFrame my_f = new MyFrame(); This class extends JFrame. It creates two panel objects and passes a reference to itself to each of the panels. This allows each panel to call methods of the MyFrame class. Notice that I did not set a size for the frame. Instead, each panel sets a preferred size and the frame calls the pack method which causes the frame to calculate its size based on the objects it contains. In addition to the panels, there is an instance variable, num, and mutator and accessor methods. Notice that whenever we change num we send a message to each panel to repaint itself. public class MyFrame extends JFrame { private Ex2_Panel left; private Ex2_Panel right; private int num = 0; public MyFrame() { settitle( "Example 2" ); setdefaultcloseoperation(jframe. EXIT_ON_CLOSE); Container pane = getcontentpane(); pane.setlayout( new GridLayout( 1, 2 ) ); left = new Ex2_Panel ( this, Color.ORANGE ); right = new Ex2_Panel ( this, Color.WHITE ); pane.add( left ); pane.add( right ); pack(); setvisible( true ); public int getnum(){ return num; public void increasenum(){ num++; left.repaint(); right.repaint();

4 The Ex2_Panel class contains a reference back to the frame that is creating the objects. Whenever the user clicks on a panel, it calls f.increasenum(); which increases num in the MyFrame object and causes each panel to repaint itself. In the paintcomponent method the panel calls f.getnum() to get the current value of num and prints it. public class Ex2_Panel extends JPanel { private MyFrame f; private static final int LENGTH = 200; public Ex2_Panel( MyFrame myf, Color c ) { f = myf; setbackground( c ); setpreferredsize( new Dimension(LENGTH, LENGTH) ); addmouselistener( new Handle() ); public void paintcomponent( Graphics g ){ super.paintcomponent( g ); g.setfont( new Font("SansSerif", Font.BOLD, 24) ); g.drawstring ("Num is " + f.getnum(), 50, 50 ); private class Handle extends MouseAdapter { public void mousepressed(mouseevent e) { f.increasenum(); Create the applet. Step 1. Create a project in DrJava. Create a new class called Run_App2. This is nearly identical to MyFrame except that (1) it extends JApplet and not JFrame; (2) the constructor is replaced by the init method; and (3) some calls to JFrame methods have been deleted. Copy Ex2_Panel.java into the project and change any references to MyFrame to Run_App2. The Run_Ex2 class, which contains the main method, is not needed in the applet version. Here is the code for the Run_App2 class. public class Run_App2 extends JApplet { private Ex2_Panel left; private Ex2_Panel right; private int num = 0; // changed from MyFrame // continued on the next page

5 public void init() { // changed from MyFrame Container pane = getcontentpane(); pane.setlayout( new GridLayout( 1, 2 ) ); left = new Ex2_Panel ( this, Color.ORANGE ); right = new Ex2_Panel ( this, Color.WHITE ); pane.add( left ); pane.add( right ); public int getnum(){ return num; public void increasenum(){ num++; left.repaint(); right.repaint(); Step 2. You create the jar file and name it the same as the class that contains the init method. Does it absolutely have to have the same name as the class that contains the init method? I don t think so but I ve had problems when I ve changed it and I haven t taken the time to get to the bottom of it. Step 3. You write an html file that displays the applet. Open Notepad or Wordpad and enter the following: <html><head><title>example 2 Applet</title></head><body> <h1>example 1</h1> <applet code = "Run_App2.class" archive = "Run_App2.jar" width = "600" height= "150" > </applet> </body></html> Save it as Ex2.html. Double-click on this file and your program should display (and work) within the web page. Notice that the size of the applet is determined by the width and height in the above html tag and not the preferred sizes of the panels.

6 Example 3. Original Program Loads and Uses an JPG. If your program works with files then you will have to make some small changes to handle that. Here is a program that displays an image. Clicking on the panel causes the image to switch to another image and back public class Run_Ex3 { public static void main( String [] args ) { JFrame f = new JFrame(); f.settitle( "Example" ); f.setsize( 300, 300 ); f.setdefaultcloseoperation( JFrame.EXIT_ON_CLOSE ); public class Ex3_Panel extends JPanel { private ImageIcon img; private boolean face = true; public Ex3_Panel() { img = new ImageIcon( "girl.jpg" ); setbackground( Color.ORANGE ); addmouselistener( new Rat() ); Container pane = f.getcontentpane(); pane.setlayout( new BorderLayout() ); Ex3_Panel p = new Ex3_Panel (); pane.add( p, BorderLayout.CENTER ); f.setvisible( true ); public void paintcomponent( Graphics g ){ super.paintcomponent( g ); int iw = img.geticonwidth(); int ih = img.geticonheight(); int w = getwidth(); int h = getheight(); int x = (w - iw)/2; int y = (h - ih)/2; img.painticon( this, g, x, y ); private class Rat extends MouseAdapter { public void mousepressed( MouseEvent e) { if ( face ) img = new ImageIcon( "fish.jpg" ); else img = new ImageIcon( "girl.jpg" ); face =!face; repaint(); If you convert the above application into an applet using the process we used before, there will be an error and the picture will not display. If you click on the Java icon in the bottom task bar and select Open 1.6.0_31 Console you ll see the following run-time error: java.security.accesscontrolexception: access denied (java.io.filepermission girl.jpg read)

7 A solution. Wherever you instantiate an ImageIcon like this: img = new ImageIcon( "fish.jpg" ); replace it with this: img = new ImageIcon(getClass().getResource( "fish.jpg" ) ); Here is the applet version of this program. public class Run_App3 extends JApplet{ public void init() { Container pane = getcontentpane(); pane.setlayout( new BorderLayout()); Ex3_Panel p = new Ex3_Panel (); pane.add( p, BorderLayout.CENTER ); public class Ex3_Panel extends JPanel { private ImageIcon img; private boolean face = true; public Ex3_Panel( ) { img = new ImageIcon( getclass().getresource( "girl.jpg" ) ); setbackground( Color.ORANGE ); addmouselistener( new Rat() ); public void paintcomponent( Graphics g ){ super.paintcomponent( g ); int iw = img.geticonwidth(); int ih = img.geticonheight(); int w = getwidth(); int h = getheight(); int x = (w - iw)/2; int y = (h - ih)/2; img.painticon( this, g, x, y ); private class Rat extends MouseAdapter { public void mousepressed(mouseevent e){ if ( face ) img = new ImageIcon( getclass().getresource( "fish.jpg" ) ); else img = new ImageIcon( getclass().getresource( "girl.jpg" )); face =!face; repaint();

public class Craps extends JFrame implements ActionListener { final int WON = 0,LOST =1, CONTINUE = 2;

public class Craps extends JFrame implements ActionListener { final int WON = 0,LOST =1, CONTINUE = 2; Lecture 15 The Game of "Craps" In the game of "craps" a player throws a pair of dice. If the sum on the faces of the pair of dice after the first toss is 7 or 11 the player wins; if the sum on the first

More information

Graphical User Interfaces

Graphical User Interfaces M14_REGE1813_02_SE_C14.qxd 2/10/10 3:43 PM Page 822 Chapter14 Graphical User Interfaces 14.1 GUI Basics Graphical Input and Output with Option Panes Working with Frames Buttons, Text Fields, and Labels

More information

CS 335 Lecture 06 Java Programming GUI and Swing

CS 335 Lecture 06 Java Programming GUI and Swing CS 335 Lecture 06 Java Programming GUI and Swing Java: Basic GUI Components Swing component overview Event handling Inner classes and anonymous inner classes Examples and various components Layouts Panels

More information

5.17 GUI. Xiaoyi Jiang Informatik I Grundlagen der Programmierung

5.17 GUI. Xiaoyi Jiang Informatik I Grundlagen der Programmierung AWT vs. Swing AWT (Abstract Window Toolkit; Package java.awt) Benutzt Steuerelemente des darunterliegenden Betriebssystems Native Code (direkt für die Maschine geschrieben, keine VM); schnell Aussehen

More information

http://netbeans.org/kb/docs/java/gui-functionality.html?print=yes

http://netbeans.org/kb/docs/java/gui-functionality.html?print=yes Page 1 of 6 Introduction to GUI Building Contributed by Saleem Gul and Tomas Pavek, maintained by Ruth Kusterer and Irina Filippova This beginner tutorial teaches you how to create a simple graphical user

More information

Using A Frame for Output

Using A Frame for Output Eventos Roteiro Frames Formatting Output Event Handling Entering Data Using Fields in a Frame Creating a Data Entry Field Using a Field Reading Data in an Event Handler Handling Multiple Button Events

More information

GUIs with Swing. Principles of Software Construction: Objects, Design, and Concurrency. Jonathan Aldrich and Charlie Garrod Fall 2012

GUIs with Swing. Principles of Software Construction: Objects, Design, and Concurrency. Jonathan Aldrich and Charlie Garrod Fall 2012 GUIs with Swing Principles of Software Construction: Objects, Design, and Concurrency Jonathan Aldrich and Charlie Garrod Fall 2012 Slides copyright 2012 by Jeffrey Eppinger, Jonathan Aldrich, William

More information

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC). The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness The Abstract Windowing Toolkit (AWT) was part of the JDK form the beginning,

More information

Programming with Java GUI components

Programming with Java GUI components Programming with Java GUI components Java includes libraries to provide multi-platform support for Graphic User Interface objects. The multi-platform aspect of this is that you can write a program on a

More information

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 7: Object-Oriented Programming. Introduction

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 7: Object-Oriented Programming. Introduction INTRODUCTION TO COMPUTER PROGRAMMING Richard Pierse Class 7: Object-Oriented Programming Introduction One of the key issues in programming is the reusability of code. Suppose that you have written a program

More information

method is never called because it is automatically called by the window manager. An example of overriding the paint() method in an Applet follows:

method is never called because it is automatically called by the window manager. An example of overriding the paint() method in an Applet follows: Applets - Java Programming for the Web An applet is a Java program designed to run in a Java-enabled browser or an applet viewer. In a browser, an applet is called into execution when the APPLET HTML tag

More information

Packaging and Deploying Java Projects in Forte

Packaging and Deploying Java Projects in Forte CHAPTER 8 Packaging and Deploying Java Projects in Forte This chapter introduces to use Forte s Archive wizard to package project files for deployment. You will also learn how to create shortcut for applications

More information

LAYOUT MANAGERS. Layout Managers Page 1. java.lang.object. java.awt.component. java.awt.container. java.awt.window. java.awt.panel

LAYOUT MANAGERS. Layout Managers Page 1. java.lang.object. java.awt.component. java.awt.container. java.awt.window. java.awt.panel LAYOUT MANAGERS A layout manager controls how GUI components are organized within a GUI container. Each Swing container (e.g. JFrame, JDialog, JApplet and JPanel) is a subclass of java.awt.container and

More information

How To Program In Java (Ipt) With A Bean And An Animated Object In A Powerpoint (For A Powerbook)

How To Program In Java (Ipt) With A Bean And An Animated Object In A Powerpoint (For A Powerbook) Graphic Interface Programming II Applets and Beans and animation in Java IT Uppsala universitet Applets Small programs embedded in web pages

More information

There are some important differences between an applet and a standalone Java application, including the following:

There are some important differences between an applet and a standalone Java application, including the following: JAVA - APPLET BASICS Copyright tutorialspoint.com An applet is a Java program that runs in a Web browser. An applet can be a fully functional Java application because it has the entire Java API at its

More information

11. Applets, normal window applications, packaging and sharing your work

11. Applets, normal window applications, packaging and sharing your work 11. Applets, normal window applications, packaging and sharing your work In this chapter Converting Full Screen experiments into normal window applications, Packaging and sharing applications packaging

More information

Introduction to Java Applets (Deitel chapter 3)

Introduction to Java Applets (Deitel chapter 3) Introduction to Java Applets (Deitel chapter 3) 1 2 Plan Introduction Sample Applets from the Java 2 Software Development Kit Simple Java Applet: Drawing a String Drawing Strings and Lines Adding Floating-Point

More information

Mouse Event Handling (cont.)

Mouse Event Handling (cont.) GUI Components: Part II Mouse Event Handling (cont.) Each mouse event-handling method receives a MouseEvent object that contains information about the mouse event that occurred, including the x- and y-coordinates

More information

How To Build A Swing Program In Java.Java.Netbeans.Netcode.Com (For Windows) (For Linux) (Java) (Javax) (Windows) (Powerpoint) (Netbeans) (Sun) (

How To Build A Swing Program In Java.Java.Netbeans.Netcode.Com (For Windows) (For Linux) (Java) (Javax) (Windows) (Powerpoint) (Netbeans) (Sun) ( Chapter 11. Graphical User Interfaces To this point in the text, our programs have interacted with their users to two ways: The programs in Chapters 1-5, implemented in Processing, displayed graphical

More information

Essentials of the Java(TM) Programming Language, Part 1

Essentials of the Java(TM) Programming Language, Part 1 Essentials of the Java(TM) Programming Language, Part 1 http://developer.java.sun.com/developer...ining/programming/basicjava1/index.html Training Index Essentials of the Java TM Programming Language:

More information

The Basic Java Applet and JApplet

The Basic Java Applet and JApplet I2PUJ4 - Chapter 6 - Applets, HTML, and GUI s The Basic Java Applet and JApplet Rob Dempster robd@cs.ukzn.ac.za School of Computer Science University of KwaZulu-Natal Pietermaritzburg Campus I2PUJ4 - Chapter

More information

During the process of creating ColorSwitch, you will learn how to do these tasks:

During the process of creating ColorSwitch, you will learn how to do these tasks: GUI Building in NetBeans IDE 3.6 This short tutorial guides you through the process of creating an application called ColorSwitch. You will build a simple program that enables you to switch the color of

More information

Assignment # 2: Design Patterns and GUIs

Assignment # 2: Design Patterns and GUIs CSUS COLLEGE OF ENGINEERING AND COMPUTER SCIENCE Department of Computer Science CSc 133 Object-Oriented Computer Graphics Programming Spring 2014 John Clevenger Assignment # 2: Design Patterns and GUIs

More information

Animazione in Java. Animazione in Java. Problemi che possono nascere, e loro soluzione. Marco Ronchetti Lezione 1

Animazione in Java. Animazione in Java. Problemi che possono nascere, e loro soluzione. Marco Ronchetti Lezione 1 Animazione in Java Problemi che possono nascere, e loro soluzione Animazione in Java Application MyFrame (JFrame) ClockPanel (JPanel) 1 public class ClockPanel extends JPanel { public ClockPanel void paintcomponent(graphics

More information

GUI Components: Part 2

GUI Components: Part 2 GUI Components: Part 2 JComboBox and Using an Anonymous Inner Class for Event Handling A combo box (or drop-down list) enables the user to select one item from a list. Combo boxes are implemented with

More information

Packaging and Deploying Java Projects in JBuilder

Packaging and Deploying Java Projects in JBuilder Packaging and Deploying Java Projects in JBuilder NOTE: This supplemental material may be used at the end of Chapter 12, Applets and Advanced Graphics. Archive builder wizard is available in JBuilder Professional

More information

CSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus

CSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus CSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus 1. Purpose This assignment exercises how to write a peer-to-peer communicating program using non-blocking

More information

Lab 1A. Create a simple Java application using JBuilder. Part 1: make the simplest Java application Hello World 1. Start Jbuilder. 2.

Lab 1A. Create a simple Java application using JBuilder. Part 1: make the simplest Java application Hello World 1. Start Jbuilder. 2. Lab 1A. Create a simple Java application using JBuilder In this lab exercise, we ll learn how to use a Java integrated development environment (IDE), Borland JBuilder 2005, to develop a simple Java application

More information

Swing. A Quick Tutorial on Programming Swing Applications

Swing. A Quick Tutorial on Programming Swing Applications Swing A Quick Tutorial on Programming Swing Applications 1 MVC Model View Controller Swing is based on this design pattern It means separating the implementation of an application into layers or components:

More information

How Scala Improved Our Java

How Scala Improved Our Java How Scala Improved Our Java Sam Reid PhET Interactive Simulations University of Colorado http://spot.colorado.edu/~reids/ PhET Interactive Simulations Provides free, open source educational science simulations

More information

Tutorial: Time Of Day Part 2 GUI Design in NetBeans

Tutorial: Time Of Day Part 2 GUI Design in NetBeans Tutorial: Time Of Day Part 2 GUI Design in NetBeans October 7, 2010 Author Goals Kees Hemerik / Gerard Zwaan Getting acquainted with NetBeans GUI Builder Illustrate the separation between GUI and computation

More information

Essentials of the Java Programming Language

Essentials of the Java Programming Language Essentials of the Java Programming Language A Hands-On Guide by Monica Pawlan 350 East Plumeria Drive San Jose, CA 95134 USA May 2013 Part Number TBD v1.0 Sun Microsystems. Inc. All rights reserved If

More information

Here's the code for our first Applet which will display 'I love Java' as a message in a Web page

Here's the code for our first Applet which will display 'I love Java' as a message in a Web page Create a Java Applet Those of you who purchased my latest book, Learn to Program with Java, know that in the book, we create a Java program designed to calculate grades for the English, Math and Science

More information

Homework/Program #5 Solutions

Homework/Program #5 Solutions Homework/Program #5 Solutions Problem #1 (20 points) Using the standard Java Scanner class. Look at http://natch3z.blogspot.com/2008/11/read-text-file-using-javautilscanner.html as an exampleof using the

More information

JiST Graphical User Interface Event Viewer. Mark Fong mjf21@cornell.edu

JiST Graphical User Interface Event Viewer. Mark Fong mjf21@cornell.edu JiST Graphical User Interface Event Viewer Mark Fong mjf21@cornell.edu Table of Contents JiST Graphical User Interface Event Viewer...1 Table of Contents...2 Introduction...3 What it does...3 Design...3

More information

LAB4 Making Classes and Objects

LAB4 Making Classes and Objects LAB4 Making Classes and Objects Objective The main objective of this lab is class creation, how its constructer creation, object creation and instantiation of objects. We will use the definition pane to

More information

Java is commonly used for deploying applications across a network. Compiled Java code

Java is commonly used for deploying applications across a network. Compiled Java code Module 5 Introduction to Java/Swing Java is commonly used for deploying applications across a network. Compiled Java code may be distributed to different machine architectures, and a native-code interpreter

More information

Flash MX Image Animation

Flash MX Image Animation Flash MX Image Animation Introduction (Preparing the Stage) Movie Property Definitions: Go to the Properties panel at the bottom of the window to choose the frame rate, width, height, and background color

More information

Lab 9. Spam, Spam, Spam. Handout 11 CSCI 134: Spring, 2015. To gain experience with Strings. Objective

Lab 9. Spam, Spam, Spam. Handout 11 CSCI 134: Spring, 2015. To gain experience with Strings. Objective Lab 9 Handout 11 CSCI 134: Spring, 2015 Spam, Spam, Spam Objective To gain experience with Strings. Before the mid-90s, Spam was a canned meat product. These days, the term spam means just one thing unwanted

More information

Making a Web Page with Microsoft Publisher 2003

Making a Web Page with Microsoft Publisher 2003 Making a Web Page with Microsoft Publisher 2003 The first thing to consider when making a Web page or a Web site is the architecture of the site. How many pages will you have and how will they link to

More information

An Overview of Java. overview-1

An Overview of Java. overview-1 An Overview of Java overview-1 Contents What is Java Major Java features Java virtual machine Java programming language Java class libraries (API) GUI Support in Java Networking and Threads in Java overview-2

More information

Hypercosm. Studio. www.hypercosm.com

Hypercosm. Studio. www.hypercosm.com Hypercosm Studio www.hypercosm.com Hypercosm Studio Guide 3 Revision: November 2005 Copyright 2005 Hypercosm LLC All rights reserved. Hypercosm, OMAR, Hypercosm 3D Player, and Hypercosm Studio are trademarks

More information

Konzepte objektorientierter Programmierung

Konzepte objektorientierter Programmierung Konzepte objektorientierter Programmierung Prof. Dr. Peter Müller Werner Dietl Software Component Technology Exercises 5: Frameworks Wintersemester 05/06 2 Homework 1 Observer Pattern From: Gamma, Helm,

More information

How To Write A Program For The Web In Java (Java)

How To Write A Program For The Web In Java (Java) 21 Applets and Web Programming As noted in Chapter 2, although Java is a general purpose programming language that can be used to create almost any type of computer program, much of the excitement surrounding

More information

Providing Information (Accessors)

Providing Information (Accessors) Providing Information (Accessors) C++ allows you to declare a method as const. As a result the compiler warns you if statements in the method change the object s state. Java has no such facility, and so

More information

Nexawebホワイトペーパー. Developing with Nexaweb ~ Nexaweb to Improve Development Productivity and Maintainability

Nexawebホワイトペーパー. Developing with Nexaweb ~ Nexaweb to Improve Development Productivity and Maintainability Nexawebホワイトペーパー Developing with Nexaweb ~ Nexaweb to Improve Development Productivity and Maintainability Nexaweb Technologies, Inc. February 2012 Overview Many companies today are creating rich internet

More information

JIDE Action Framework Developer Guide

JIDE Action Framework Developer Guide JIDE Action Framework Developer Guide Contents PURPOSE OF THIS DOCUMENT... 1 WHAT IS JIDE ACTION FRAMEWORK... 1 PACKAGES... 3 MIGRATING FROM EXISTING APPLICATIONS... 3 DOCKABLEBARMANAGER... 9 DOCKABLE

More information

Extending Desktop Applications to the Web

Extending Desktop Applications to the Web Extending Desktop Applications to the Web Arno Puder San Francisco State University Computer Science Department 1600 Holloway Avenue San Francisco, CA 94132 arno@sfsu.edu Abstract. Web applications have

More information

// Correntista. //Conta Corrente. package Banco; public class Correntista { String nome, sobrenome; int cpf;

// Correntista. //Conta Corrente. package Banco; public class Correntista { String nome, sobrenome; int cpf; // Correntista public class Correntista { String nome, sobrenome; int cpf; public Correntista(){ nome = "zé"; sobrenome = "Pereira"; cpf = 123456; public void setnome(string n){ nome = n; public void setsobrenome(string

More information

Java applets. SwIG Jing He

Java applets. SwIG Jing He Java applets SwIG Jing He Outline What is Java? Java Applications Java Applets Java Applets Securities Summary What is Java? Java was conceived by James Gosling at Sun Microsystems Inc. in 1991 Java is

More information

understand how image maps can enhance a design and make a site more interactive know how to create an image map easily with Dreamweaver

understand how image maps can enhance a design and make a site more interactive know how to create an image map easily with Dreamweaver LESSON 3: ADDING IMAGE MAPS, ANIMATION, AND FORMS CREATING AN IMAGE MAP OBJECTIVES By the end of this part of the lesson you will: understand how image maps can enhance a design and make a site more interactive

More information

GUI Event-Driven Programming

GUI Event-Driven Programming GUI Event-Driven Programming CSE 331 Software Design & Implementation Slides contain content by Hal Perkins and Michael Hotan 1 Outline User events and callbacks Event objects Event listeners Registering

More information

public class Application extends JFrame implements ChangeListener, WindowListener, MouseListener, MouseMotionListener {

public class Application extends JFrame implements ChangeListener, WindowListener, MouseListener, MouseMotionListener { Application.java import javax.swing.*; import java.awt.geom.*; import java.awt.event.*; import javax.swing.event.*; import java.util.*; public class Application extends JFrame implements ChangeListener,

More information

Yosemite National Park, California. CSE 114 Computer Science I Inheritance

Yosemite National Park, California. CSE 114 Computer Science I Inheritance Yosemite National Park, California CSE 114 Computer Science I Inheritance Containment A class contains another class if it instantiates an object of that class HAS-A also called aggregation PairOfDice

More information

Java GUI Programming. Building the GUI for the Microsoft Windows Calculator Lecture 2. Des Traynor 2005

Java GUI Programming. Building the GUI for the Microsoft Windows Calculator Lecture 2. Des Traynor 2005 Java GUI Programming Building the GUI for the Microsoft Windows Calculator Lecture 2 Des Traynor 2005 So, what are we up to Today, we are going to create the GUI for the calculator you all know and love.

More information

WEEK 2 DAY 14. Writing Java Applets and Java Web Start Applications

WEEK 2 DAY 14. Writing Java Applets and Java Web Start Applications WEEK 2 DAY 14 Writing Java Applets and Java Web Start Applications The first exposure of many people to the Java programming language is in the form of applets, small and secure Java programs that run

More information

Java Appletek II. Applet GUI

Java Appletek II. Applet GUI THE INTERNET,mapped on the opposite page, is a scalefree network in that Java Appletek II. dis.'~tj port,from BYALBERTU\SZLOBARABASI ANDERICBONABEAU THE INTERNET,mapped on the opposite page, is a scalefree

More information

Interactive Programs and Graphics in Java

Interactive Programs and Graphics in Java Interactive Programs and Graphics in Java Alark Joshi Slide credits: Sami Rollins Announcements Lab 1 is due today Questions/concerns? SVN - Subversion Versioning and revision control system 1. allows

More information

(These instructions are only meant to get you started. They do not include advanced features.)

(These instructions are only meant to get you started. They do not include advanced features.) FrontPage XP/2003 HOW DO I GET STARTED CREATING A WEB PAGE? Previously, the process of creating a page on the World Wide Web was complicated. Hypertext Markup Language (HTML) is a relatively simple computer

More information

file://c:\dokumente und Einstellungen\Marco Favorito\Desktop\ScanCmds.html

file://c:\dokumente und Einstellungen\Marco Favorito\Desktop\ScanCmds.html file:c:\dokumente und Einstellungen\Marco Favorito\Desktop\ScanCmds.html Seite 1 von 5 ScanCmds.java ------------------------------------------------------------------------------- ScanCmds Demontration

More information

Java with Eclipse: Setup & Getting Started

Java with Eclipse: Setup & Getting Started Java with Eclipse: Setup & Getting Started Originals of slides and source code for examples: http://courses.coreservlets.com/course-materials/java.html Also see Java 8 tutorial: http://www.coreservlets.com/java-8-tutorial/

More information

DREAMWEAVER BASICS. A guide to updating Faculty websites Created by the Advancement & Marketing Unit

DREAMWEAVER BASICS. A guide to updating Faculty websites Created by the Advancement & Marketing Unit DREAMWEAVER BASICS A guide to updating Faculty websites Created by the Advancement & Marketing Unit Table of content Tip: Click on the links below to go straight to the desired section The W (Web Services)

More information

Using e-mail and the Internet

Using e-mail and the Internet Using e-mail and the Internet New to Windows 7? Even though there s a lot in common with the version of Windows that you had before, you might still need a hand getting up to speed. This guide is filled

More information

Informatik II. // ActionListener hinzufügen btnconvert.addactionlistener(this); super.setdefaultcloseoperation(jframe.

Informatik II. // ActionListener hinzufügen btnconvert.addactionlistener(this); super.setdefaultcloseoperation(jframe. Universität Augsburg, Institut für Informatik Sommersemester 2006 Prof. Dr. Werner Kießling 20. Juli. 2006 M. Endres, A. Huhn, T. Preisinger Lösungsblatt 11 Aufgabe 1: Währungsrechner CurrencyConverter.java

More information

Searching your Archive in Outlook (Normal)

Searching your Archive in Outlook (Normal) Searching your Archive in Outlook (Normal) 1. View the Archive Add in toolbar. In Outlook 2007, the toolbar displays below the standard Outlook toolbars. In Outlook 2010, select the McAfee tab. 2. In the

More information

creating a text-based editor for eclipse

creating a text-based editor for eclipse creating a text-based editor for eclipse By Elwin Ho Contact author at: Elwin.Ho@hp.com June 2003 2003 HEWLETT-PACKARD COMPANY TABLE OF CONTENTS Purpose...3 Overview of the Eclipse Workbench...4 Creating

More information

CB Advanced: Innovative Document Templates

CB Advanced: Innovative Document Templates CB Advanced: Innovative Document Templates Sending personalized letters frequently helps build stronger relationships with clients. That's one of the things that ClientBase does best. A library of customizable

More information

Importance of the Java Inet Address and Public String Hosting System

Importance of the Java Inet Address and Public String Hosting System CSC 551: Web Programming Spring 2004 Combining Java & JavaScript integrating Java with JavaScript calling Java routines from JavaScript controlling an applet from JavaScript accessing JavaScript & HTML

More information

Using FileMaker Pro with Microsoft Office

Using FileMaker Pro with Microsoft Office Hands-on Guide Using FileMaker Pro with Microsoft Office Making FileMaker Pro Your Office Companion page 1 Table of Contents Introduction... 3 Before You Get Started... 4 Sharing Data between FileMaker

More information

Dashboard Skin Tutorial. For ETS2 HTML5 Mobile Dashboard v3.0.2

Dashboard Skin Tutorial. For ETS2 HTML5 Mobile Dashboard v3.0.2 Dashboard Skin Tutorial For ETS2 HTML5 Mobile Dashboard v3.0.2 Dashboard engine overview Dashboard menu Skin file structure config.json Available telemetry properties dashboard.html dashboard.css Telemetry

More information

Karsten Lentzsch JGoodies SWING WITH STYLE

Karsten Lentzsch JGoodies SWING WITH STYLE Karsten Lentzsch JGoodies SWING WITH STYLE JGoodies: Karsten Lentzsch Open source Swing libraries Example applications Consultant for Java desktop Design assistance Training for visual design and implementation

More information

Java SE 6 Update 10. la piattaforma Java per le RIA. Corrado De Bari. Sun Microsystems Italia Spa. Software & Java Ambassador

Java SE 6 Update 10. la piattaforma Java per le RIA. Corrado De Bari. Sun Microsystems Italia Spa. Software & Java Ambassador Java SE 6 Update 10 & JavaFX: la piattaforma Java per le RIA Corrado De Bari Software & Java Ambassador Sun Microsystems Italia Spa 1 Agenda What's news in Java Runtime Environment JavaFX Technology Key

More information

Fireworks 3 Animation and Rollovers

Fireworks 3 Animation and Rollovers Fireworks 3 Animation and Rollovers What is Fireworks Fireworks is Web graphics program designed by Macromedia. It enables users to create any sort of graphics as well as to import GIF, JPEG, PNG photos

More information

Advanced Network Programming Lab using Java. Angelos Stavrou

Advanced Network Programming Lab using Java. Angelos Stavrou Advanced Network Programming Lab using Java Angelos Stavrou Table of Contents A simple Java Client...3 A simple Java Server...4 An advanced Java Client...5 An advanced Java Server...8 A Multi-threaded

More information

Web Services using Tomcat and Eclipse

Web Services using Tomcat and Eclipse Web Services using Tomcat and Eclipse Nauman recluze@gmail.com Security Engineering Research Group Institute of Management Sciences Peshawar, Pakistan http://recluze.wordpress.com http://serg.imsciences.edu.pk

More information

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling

More information

Creating Web Pages with Microsoft FrontPage

Creating Web Pages with Microsoft FrontPage Creating Web Pages with Microsoft FrontPage 1. Page Properties 1.1 Basic page information Choose File Properties. Type the name of the Title of the page, for example Template. And then click OK. Short

More information

STATGRAPHICS Online. Statistical Analysis and Data Visualization System. Revised 6/21/2012. Copyright 2012 by StatPoint Technologies, Inc.

STATGRAPHICS Online. Statistical Analysis and Data Visualization System. Revised 6/21/2012. Copyright 2012 by StatPoint Technologies, Inc. STATGRAPHICS Online Statistical Analysis and Data Visualization System Revised 6/21/2012 Copyright 2012 by StatPoint Technologies, Inc. All rights reserved. Table of Contents Introduction... 1 Chapter

More information

With a single download, the ADT Bundle includes everything you need to begin developing apps:

With a single download, the ADT Bundle includes everything you need to begin developing apps: Get the Android SDK The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android. The ADT bundle includes the essential Android SDK components

More information

A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION

A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION Tao Chen 1, Tarek Sobh 2 Abstract -- In this paper, a software application that features the visualization of commonly used

More information

Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition

Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition This book may be ordered from Addison-Wesley in a value pack that includes Microsoft Visual C++ 2010 Express Edition. Visual C++ 2010

More information

An Informational User Guide for: Web Conferencing

An Informational User Guide for: Web Conferencing Allows You to: Manage your audio conference online using easy point and click conference commands Show slide presentations and graphics to meeting participants Show your desktop to meeting participants

More information

Introduction to MS WINDOWS XP

Introduction to MS WINDOWS XP Introduction to MS WINDOWS XP Mouse Desktop Windows Applications File handling Introduction to MS Windows XP 2 Table of Contents What is Windows XP?... 3 Windows within Windows... 3 The Desktop... 3 The

More information

Appendix K Introduction to Microsoft Visual C++ 6.0

Appendix K Introduction to Microsoft Visual C++ 6.0 Appendix K Introduction to Microsoft Visual C++ 6.0 This appendix serves as a quick reference for performing the following operations using the Microsoft Visual C++ integrated development environment (IDE):

More information

Website Development Komodo Editor and HTML Intro

Website Development Komodo Editor and HTML Intro Website Development Komodo Editor and HTML Intro Introduction In this Assignment we will cover: o Use of the editor that will be used for the Website Development and Javascript Programming sections of

More information

CS 170 Java Programming 1. Welcome to CS 170. All about CS 170 The CS 170 Online Materials Java Mechanics: Your First Program

CS 170 Java Programming 1. Welcome to CS 170. All about CS 170 The CS 170 Online Materials Java Mechanics: Your First Program CS 170 Java Programming 1 Welcome to CS 170 All about CS 170 The CS 170 Online Materials Java Mechanics: Your First Program What s the Plan? Topic I: What s CS 170 All About? Contact information Topics,

More information

DHBW Karlsruhe, Vorlesung Programmieren, Remote Musterlösungen

DHBW Karlsruhe, Vorlesung Programmieren, Remote Musterlösungen DHBW Karlsruhe, Vorlesung Programmieren, Remote Musterlösungen Aufgabe 1 RMI - TimeService public interface TimeServerInterface extends Remote { public String gettime() throws RemoteException; import java.util.date;

More information

Customizing the SSOSessionTimeout.jsp page for Kofax Front Office Server 3.5.2

Customizing the SSOSessionTimeout.jsp page for Kofax Front Office Server 3.5.2 Customizing the SSOSessionTimeout.jsp page for Kofax Front Office Server 3.5.2 Date July 23, 2014 Applies To Kofax Front Office Server (KFS) 3.5.2.10 Summary This application note provides instructions

More information

Module 1. 4 Login-Send Message to Teacher

Module 1. 4 Login-Send Message to Teacher Module 1. 4 Login-Send Message to Teacher Students, in this lesson you will 1. Learn to login to your InterAct account. 2. Learn how to send an email message. Logging on to Students Online 1. Launch the

More information

Event-Driven Programming

Event-Driven Programming Event-Driven Programming Lecture 4 Jenny Walter Fall 2008 Simple Graphics Program import acm.graphics.*; import java.awt.*; import acm.program.*; public class Circle extends GraphicsProgram { public void

More information

Software for Producing Rack Layouts and Purchase Orders

Software for Producing Rack Layouts and Purchase Orders 1 Software for Producing Rack Layouts and Purchase Orders Welcome to RackTools: software that makes it simple and quick to specify Middle Atlantic Products. RackTools has been designed with one purpose

More information

Going Above and Beyond

Going Above and Beyond Whitepaper Going Above and Beyond Using Advanced Techniques to Create Customized HTML Templates August 3, 2010 Copyright 2010 L-Soft international, Inc. Information in this document is subject to change

More information

KFUPM. Web Content Management System powered by SharePoint 2010. www.kfupm.edu.sa 1

KFUPM. Web Content Management System powered by SharePoint 2010. www.kfupm.edu.sa 1 KFUPM Web Content Management System powered by SharePoint 2010 1 Sample Department Site Site Actions Steps to login for administrators Navigate to your website and type in the url /admin.aspx

More information

CS170 Lab 11 Abstract Data Types & Objects

CS170 Lab 11 Abstract Data Types & Objects CS170 Lab 11 Abstract Data Types & Objects Introduction: Abstract Data Type (ADT) An abstract data type is commonly known as a class of objects An abstract data type in a program is used to represent (the

More information

LAB 1: Getting started with WebMatrix. Introduction. Creating a new database. M1G505190: Introduction to Database Development

LAB 1: Getting started with WebMatrix. Introduction. Creating a new database. M1G505190: Introduction to Database Development LAB 1: Getting started with WebMatrix Introduction In this module you will learn the principles of database development, with the help of Microsoft WebMatrix. WebMatrix is a software application which

More information

MICROSOFT OUTLOOK 2010 READ, ORGANIZE, SEND AND RESPONSE E-MAILS

MICROSOFT OUTLOOK 2010 READ, ORGANIZE, SEND AND RESPONSE E-MAILS MICROSOFT OUTLOOK 2010 READ, ORGANIZE, SEND AND RESPONSE E-MAILS Last Edited: 2012-07-09 1 Read Emails... 4 Find the inbox... 4 Change new incoming e-mail notification options... 5 Read email... 6 Change

More information

Contents. Launching FrontPage... 3. Working with the FrontPage Interface... 3 View Options... 4 The Folders List... 5 The Page View Frame...

Contents. Launching FrontPage... 3. Working with the FrontPage Interface... 3 View Options... 4 The Folders List... 5 The Page View Frame... Using Microsoft Office 2003 Introduction to FrontPage Handout INFORMATION TECHNOLOGY SERVICES California State University, Los Angeles Version 1.0 Fall 2005 Contents Launching FrontPage... 3 Working with

More information

Summer Internship 2013

Summer Internship 2013 Summer Internship 2013 Group IV - Enhancement of Jmeter Week 4 Report 1 9 th June 2013 Shekhar Saurav Report on Configuration Element Plugin 'SMTP Defaults' Configuration Elements or config elements are

More information

Adobe Illustrator CS6. Illustrating Innovative Web Design

Adobe Illustrator CS6. Illustrating Innovative Web Design Overview In this seminar, you will learn how to create a basic graphic in Illustrator, export that image for web use, and apply it as the background for a section of a web page. You will use both Adobe

More information

J a v a Quiz (Unit 3, Test 0 Practice)

J a v a Quiz (Unit 3, Test 0 Practice) Computer Science S-111a: Intensive Introduction to Computer Science Using Java Handout #11 Your Name Teaching Fellow J a v a Quiz (Unit 3, Test 0 Practice) Multiple-choice questions are worth 2 points

More information