Appendix D Main Applet for Web-Based 3D Experiment

Size: px
Start display at page:

Download "Appendix D Main Applet for Web-Based 3D Experiment"

Transcription

1 0 Ko & Cheng Appendix D Main Applet for Web-Based 3D Experiment d.1 ImportInG libraries import java.awt.borderlayout; import java.applet.applet; import java.awt.event.*; import com.sun.j3d.utils.applet.mainframe; import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; import com.sun.j3d.utils.image.textureloader; import java.net.*; import javax.swing.*; import java.awt.*; d.2 main applet for creating all objects In laboratory public class Oscilloscope extends Applet implements ActionListener // Osci private java.net.url Ch1 = null; private java.net.url Ch2 = null; private java.net.url Vposi = null; private java.net.url Mode = null; private java.net.url Volts = null;

2 Appendix D 0 private java.net.url Source = null; private java.net.url Sync = null; private java.net.url Ac = null; private java.net.url Add = null; private java.net.url Hposi = null; private java.net.url Vdiv = null; private java.net.url Trig = null; private java.net.url Tdiv = null; private java.net.url Focus = null; private java.net.url Intensity = null; private java.net.url Blank = null; private java.net.url Cal = null; private java.net.url Input = null; private java.net.url Output = null; private java.net.url Line = null; private java.net.url Gnd = null; private java.net.url Branch = null; // Sg private java.net.url Case = null; private java.net.url Backside = null; private java.net.url Leftside = null; private java.net.url Rightside = null; private java.net.url Calconnector = null; private java.net.url Power = null; private java.net.url Left = null; private java.net.url Right = null; private java.net.url Wave = null; private java.net.url Amp = null; private java.net.url Freq = null; private java.net.url switcher = null; private java.net.url Dot = null; private java.net.url Battery = null; // Pass private java.net.url brick = null; private java.net.url floor = null; private java.net.url ceiling = null; private java.net.url Door = null; private java.net.url Desk = null; private java.net.url Desk1 = null; private java.net.url Outside01 = null; private java.net.url Outside02 = null; private java.net.url Airbus01 = null; private java.net.url Picture01 = null; private java.net.url Picture02 = null; private java.net.url Picture03 = null; private java.net.url Picture04 = null; private java.net.url Vlabposter01 = null; private java.net.url Vlabposter02 = null; private java.net.url Vlabname = null; private java.net.url D0 = null; private java.net.url D1 = null;

3 0 Ko & Cheng private java.net.url D2 = null; private java.net.url D3 = null; private java.net.url D4 = null; private java.net.url D5 = null; private java.net.url D6 = null; private java.net.url D7 = null; private java.net.url D8 = null; private java.net.url D9 = null; private java.net.url C = null; private java.net.url OK = null; private java.net.url Yellowplug = null; private java.net.url Redplug = null; private java.net.url Blueplug = null; private java.net.url Greenplug = null; private java.net.url image = null; private java.net.url image1 = null; private URL helpfile = null; private java.net.url cir_board = null; // private View view = null; private SimpleUniverse u = null; private Scene3D scene3d = null; private static final int VIRTUAL_EYE = 2; private OPanel panel; d.3 InItIalIZatIon function for main applet public void init() setlayout(new BorderLayout()); Canvas3D c = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); add( Center, c); timerfield timer = new timerfield(4); String path = getcodebase().tostring(); LoadPanel(); panel = new OPanel(image, image1, timer); //Loading the panel of the 2D part add( South, panel); panel.forward.addactionlistener(this); LoadCir_Board(); scene3d = new Scene3D(cir_board); //Loading the the 3D part scene3d.setpanel(panel); //Loading the the 3D part LoadTextured(); u = new SimpleUniverse(c); BranchGroup scene = scene3d.createscenegraph(u, c); u.addbranchgraph(scene);

4 Appendix D view = u.getviewer().getview(); view.setfrontclippolicy(virtual_eye); view.setfrontclipdistance(0.05); view.setwindowresizepolicy(1); view.setwindowmovementpolicy(1); //Modifying the view parameters d.4 destroying function for main applet public void destroy() if (scene3d!=null) scene3d.closeall(); u.removealllocales(); d.5 loading vrml based circuit board object for main applet public void LoadCir_Board() cir_board = new java.net.url(getcodebase().tostring()+ models/battary.wrl ); catch (java.net.malformedurlexception ex) d.6 loading pictures for 3d Walls and environment for main applet public void LoadPanel() image = new java.net.url(getcodebase().tostring()+ images/rectangle.jpg ); catch (java.net.malformedurlexception ex) image1 = new java.net.url(getcodebase().tostring()+ images/rotate.jpg ); catch (java.net.malformedurlexception ex)

5 Ko & Cheng d.7 definig usual function for keyboard and mouse Inputs for main applet public void actionperformed(actionevent event) /* if (event.getsource()==panel.forward) try helpfile = new URL(getCodeBase().toString() + vrosciexp1.html ); catch(java.net.malformedurlexception ex) getappletcontext().showdocument(helpfile, help ); */ d.8 loading pictures for defining texture on Instruments for main applet public void LoadTextured() // Osci Ch1 = new java.net.url(getcodebase().tostring() + images/ch1.gif ); catch (java.net.malformedurlexception ex) scene3d.ch1 = new TextureLoader(Ch1, this).gettexture(); Ch2 = new java.net.url(getcodebase().tostring() + images/ch2.gif ); catch (java.net.malformedurlexception ex) scene3d.ch2 = new TextureLoader(Ch2, this).gettexture(); Vposi = new java.net.url(getcodebase().tostring() + images/vposi.gif );

6 Appendix D catch (java.net.malformedurlexception ex) scene3d.vposi = new TextureLoader(Vposi, this).gettexture(); Mode = new java.net.url(getcodebase().tostring() + images/mode.gif ); catch (java.net.malformedurlexception ex) scene3d.mode = new TextureLoader(Mode, this).gettexture(); Volts = new java.net.url(getcodebase().tostring() + images/volts.gif ); catch (java.net.malformedurlexception ex) scene3d.volts = new TextureLoader(Volts, this).gettexture(); Source = new java.net.url(getcodebase().tostring() + images/source.gif ); catch (java.net.malformedurlexception ex) scene3d.source = new TextureLoader(Source, this).gettexture(); Sync = new java.net.url(getcodebase().tostring() + images/sync.gif ); catch (java.net.malformedurlexception ex) scene3d.sync = new TextureLoader(Sync, this).gettexture(); Ac = new java.net.url(getcodebase().tostring() + images/ac.gif ); catch (java.net.malformedurlexception ex) scene3d.ac = new TextureLoader(Ac, this).gettexture(); Add = new java.net.url(getcodebase().tostring() + images/add.gif ); catch (java.net.malformedurlexception ex) scene3d.add = new TextureLoader(Add, this).gettexture(); Hposi = new java.net.url(getcodebase().tostring() + images/hposi.gif ); catch (java.net.malformedurlexception ex)

7 Ko & Cheng scene3d.hposi = new TextureLoader(Hposi, this).gettexture(); Vdiv = new java.net.url(getcodebase().tostring() + images/vdiv.gif ); catch (java.net.malformedurlexception ex) scene3d.vdiv = new TextureLoader(Vdiv, this).gettexture(); Trig = new java.net.url(getcodebase().tostring() + images/trig.gif ); catch (java.net.malformedurlexception ex) scene3d.trig = new TextureLoader(Trig, this).gettexture(); Tdiv = new java.net.url(getcodebase().tostring() + images/tdiv.gif ); catch (java.net.malformedurlexception ex) scene3d.tdiv = new TextureLoader(Tdiv, this).gettexture(); Focus = new java.net.url(getcodebase().tostring() + images/focus.gif ); catch (java.net.malformedurlexception ex) scene3d.focus = new TextureLoader(Focus, this).gettexture(); Intensity = new java.net.url(getcodebase().tostring() + images/intensity.gif ); catch (java.net.malformedurlexception ex) scene3d.intensity = new TextureLoader(Intensity, this).gettexture(); Blank = new java.net.url(getcodebase().tostring() + images/blank.gif ); catch (java.net.malformedurlexception ex) scene3d.blank = new TextureLoader(Blank, this).gettexture(); Cal = new java.net.url(getcodebase().tostring() + images/cal.gif ); catch (java.net.malformedurlexception ex) scene3d.cal = new TextureLoader(Cal, this).gettexture();

8 Appendix D Input = new java.net.url(getcodebase().tostring() + images/input.gif ); catch (java.net.malformedurlexception ex) scene3d.input = new TextureLoader(Input, this).gettexture(); Output = new java.net.url(getcodebase().tostring() + images/output01.gif ); catch (java.net.malformedurlexception ex) scene3d.output = new TextureLoader(Output, this).gettexture(); Gnd = new java.net.url(getcodebase().tostring() + images/gnd.gif ); catch (java.net.malformedurlexception ex) scene3d.gnd = new TextureLoader(Gnd, this).gettexture(); // Sg Case = new java.net.url(getcodebase().tostring() + images/case.jpg ); catch (java.net.malformedurlexception ex) scene3d.case = new TextureLoader(Case, this).gettexture(); Backside = new java.net.url(getcodebase().tostring() + images/backside.gif ); catch (java.net.malformedurlexception ex) scene3d.backside = new TextureLoader(Backside, this).gettexture(); Rightside = new java.net.url(getcodebase().tostring() + images/rightside.gif ); catch (java.net.malformedurlexception ex) scene3d.rightside = new TextureLoader(Rightside, this).gettexture(); Leftside = new java.net.url(getcodebase().tostring() + images/leftside.gif ); catch (java.net.malformedurlexception ex) scene3d.leftside = new TextureLoader(Leftside, this).gettexture(); Calconnector = new java.net.url(getcodebase().tostring() + images/connector.gif ); catch (java.net.malformedurlexception ex)

9 Ko & Cheng scene3d.calconnector = new TextureLoader(Calconnector, this).gettexture(); Power = new java.net.url(getcodebase().tostring() + images/power.gif ); catch (java.net.malformedurlexception ex) scene3d.power = new TextureLoader(Power, this).gettexture(); Left = new java.net.url(getcodebase().tostring() + images/left.gif ); catch (java.net.malformedurlexception ex) scene3d.left = new TextureLoader(Left, this).gettexture(); Right = new java.net.url(getcodebase().tostring() + images/right.gif ); catch (java.net.malformedurlexception ex) scene3d.right = new TextureLoader(Right, this).gettexture(); Wave = new java.net.url(getcodebase().tostring() + images/wave.gif ); catch (java.net.malformedurlexception ex) scene3d.wave = new TextureLoader(Wave, this).gettexture(); Amp = new java.net.url(getcodebase().tostring() + images/amp.gif ); catch (java.net.malformedurlexception ex) scene3d.amp = new TextureLoader(Amp, this).gettexture(); Freq = new java.net.url(getcodebase().tostring() + images/freq.gif ); catch (java.net.malformedurlexception ex) scene3d.freq = new TextureLoader(Freq, this).gettexture(); switcher = new java.net.url(getcodebase().tostring() + images/switcher.gif ); catch (java.net.malformedurlexception ex)

10 Appendix D scene3d.switcher = new TextureLoader(switcher, this).gettexture(); Dot = new java.net.url(getcodebase().tostring() + images/plug02.gif ); catch (java.net.malformedurlexception ex) scene3d.dot = new TextureLoader(Dot, this).gettexture(); Redplug = new java.net.url(getcodebase().tostring() + images/redplug.gif ); catch (java.net.malformedurlexception ex) scene3d.redplug = new TextureLoader(Redplug, this).gettexture(); Greenplug = new java.net.url(getcodebase().tostring() + images/greenplug.gif ); catch (java.net.malformedurlexception ex) scene3d.greenplug = new TextureLoader(Greenplug, this).gettexture(); Blueplug = new java.net.url(getcodebase().tostring() + images/blueplug.gif ); catch (java.net.malformedurlexception ex) scene3d.blueplug = new TextureLoader(Blueplug, this).gettexture(); Yellowplug = new java.net.url(getcodebase().tostring() + images/yellowplug.gif ); catch (java.net.malformedurlexception ex) scene3d.yellowplug = new TextureLoader(Yellowplug, this).gettexture(); // Pass brick = new java.net.url(getcodebase().tostring() + images/wall.jpg ); catch (java.net.malformedurlexception ex) scene3d.brick = new TextureLoader(brick, this).gettexture(); floor = new java.net.url(getcodebase().tostring() + images/floor.jpg ); catch (java.net.malformedurlexception ex) scene3d.texfloor = new TextureLoader(floor, this).gettexture();

11 Ko & Cheng ceiling = new java.net.url(getcodebase().tostring() + images/ceiling.jpg ); catch (java.net.malformedurlexception ex) scene3d.ceiling = new TextureLoader(ceiling, this).gettexture(); Door = new java.net.url(getcodebase().tostring() + images/door.gif ); catch (java.net.malformedurlexception ex) scene3d.door = new TextureLoader(Door, this).gettexture(); Desk = new java.net.url(getcodebase().tostring() + images/desk.jpg ); catch (java.net.malformedurlexception ex) scene3d.desk = new TextureLoader(Desk, this).gettexture(); Desk1 = new java.net.url(getcodebase().tostring() + images/desk1.jpg ); catch (java.net.malformedurlexception ex) scene3d.desk1 = new TextureLoader(Desk1, this).gettexture(); Outside01 = new java.net.url(getcodebase().tostring() + images/outside.jpg ); catch (java.net.malformedurlexception ex) scene3d.outside01 = new TextureLoader(Outside01, this).gettexture(); Outside02 = new java.net.url(getcodebase().tostring() + images/outside02.gif ); catch (java.net.malformedurlexception ex) scene3d.outside02 = new TextureLoader(Outside02, this).gettexture(); Airbus01 = new java.net.url(getcodebase().tostring() + images/airbus01.gif ); catch (java.net.malformedurlexception ex) scene3d.airbus01 = new TextureLoader(Airbus01, this).gettexture(); Picture01 = new java.net.url(getcodebase().tostring() + images/picture01.jpg ); catch (java.net.malformedurlexception ex)

12 Appendix D scene3d.picture01 = new TextureLoader(Picture01, this).gettexture(); Picture02 = new java.net.url(getcodebase().tostring() + images/picture02.jpg ); catch (java.net.malformedurlexception ex) scene3d.picture02 = new TextureLoader(Picture02, this).gettexture(); Picture03 = new java.net.url(getcodebase().tostring() + images/picture03.jpg ); catch (java.net.malformedurlexception ex) scene3d.picture03 = new TextureLoader(Picture03, this).gettexture(); Picture04 = new java.net.url(getcodebase().tostring() + images/picture04.jpg ); catch (java.net.malformedurlexception ex) scene3d.picture04 = new TextureLoader(Picture04, this).gettexture(); Vlabposter01 = new java.net.url(getcodebase().tostring() + images/vlabposter01.jpg ); catch (java.net.malformedurlexception ex) scene3d.vlabposter01 = new TextureLoader(Vlabposter01, this).gettexture(); Vlabposter02 = new java.net.url(getcodebase().tostring() + images/vlabposter02.jpg ); catch (java.net.malformedurlexception ex) scene3d.vlabposter02 = new TextureLoader(Vlabposter02, this).gettexture(); Vlabname = new java.net.url(getcodebase().tostring() + images/vlabname.gif ); catch (java.net.malformedurlexception ex) scene3d.vlabname = new TextureLoader(Vlabname, this).gettexture(); C = new java.net.url(getcodebase().tostring() + images/c.gif ); catch (java.net.malformedurlexception ex) scene3d.c = new TextureLoader(C, this).gettexture();

13 0 Ko & Cheng OK = new java.net.url(getcodebase().tostring() + images/ok.gif ); catch (java.net.malformedurlexception ex) scene3d.ok = new TextureLoader(OK, this).gettexture(); d.9 defining countdown timer object for GIvInG remaining time for main applet class timerfield extends JTextField implements Runnable private boolean running = false; private Thread timerthread; public timerfield(int col) setcolumns(col); seteditable(false); //setbackground(color.white); //setbounds(1, 1, 20, 20); running = true; timerthread = new Thread(this); timerthread.start(); public void run() int min, sec; String minute, second; long starttime, currenttime; starttime = System.currentTimeMillis(); while (running) currenttime = System.currentTimeMillis(); min = Math.round((currentTime - starttime) / 60000L); sec = Math.round((currentTime - starttime - min * 60000L) / 1000); minute = Integer.toString(min); second = Integer.toString(sec); if (minute.length() < 2) minute = 0 + minute; if (second.length() < 2) second = 0 + second; settext( +minute+ : +second);

14 Appendix D if (min==29&&sec==59) if (scene3d!=null) scene3d.closeall(); running = false; timerthread.sleep(1000); catch (Exception ie) System.out.println( Interrupted Exception! ); d.10 entry for main applet // The following allows it to be run as an application as well as an applet public static void main(string[] args) new MainFrame(new Oscilloscope(), 1024, 600);

Introduction. Introduction

Introduction. Introduction Introduction Many Java application use a graphical user interface or GUI (pronounced gooey ). A GUI is a graphical window or windows that provide interaction with the user. GUI s accept input from: the

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor: Alan

More information

Appendix G Navigation and Collision Detection for Web-Based 3D Experiment

Appendix G Navigation and Collision Detection for Web-Based 3D Experiment Appendix G Appendix G Navigation and Collision Detection for Web-Based 3D Experiment G.1 ImportInG libraries import javax.media.j3d.*; import javax.vecmath.*; import java.awt.event.*; import java.awt.awtevent;

More information

CS108, Stanford Handout #22. Thread 3 GUI

CS108, Stanford Handout #22. Thread 3 GUI CS108, Stanford Handout #22 Winter, 2006-07 Nick Parlante Thread 3 GUI GUIs and Threading Problem: Swing vs. Threads How to integrate the Swing/GUI/drawing system with threads? Problem: The GUI system

More information

H212 Introduction to Software Systems Honors

H212 Introduction to Software Systems Honors Introduction to Software Systems Honors Lecture #19: November 4, 2015 1/14 Third Exam The third, Checkpoint Exam, will be on: Wednesday, November 11, 2:30 to 3:45 pm You will have 3 questions, out of 9,

More information

CS 3331 Advanced Object-Oriented Programming. Final Exam

CS 3331 Advanced Object-Oriented Programming. Final Exam 1 Fall 2006 (Thursday, December 7) Name: CS 3331 Advanced Object-Oriented Programming Final Exam This test has 6 questions and pages numbered 1 through 12. Reminders This test is open book. You may also

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus INTERNAL ASSESSMENT TEST II Date : 20-09-2016 Max Marks: 50 Subject & Code: JAVA & J2EE (10IS752) Section : A & B Name of faculty: Sreenath M V Time : 8.30-10.00 AM Note: Answer all five questions 1) a)

More information

AP CS Unit 11: Graphics and Events

AP CS Unit 11: Graphics and Events AP CS Unit 11: Graphics and Events This packet shows how to create programs with a graphical interface in a way that is consistent with the approach used in the Elevens program. Copy the following two

More information

G51PRG: Introduction to Programming Second semester Applets and graphics

G51PRG: Introduction to Programming Second semester Applets and graphics G51PRG: Introduction to Programming Second semester Applets and graphics Natasha Alechina School of Computer Science & IT nza@cs.nott.ac.uk Previous two lectures AWT and Swing Creating components and putting

More information

830512@itri.org.tw import java.net.socket; import java.net.serversocket; import java.io.ioexception; /* ---------- Java Server ---------- */ public class Nets static Socket thesocket; static ServerThread

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor:

More information

Graphical User Interfaces (GUIs)

Graphical User Interfaces (GUIs) CMSC 132: Object-Oriented Programming II Graphical User Interfaces (GUIs) Department of Computer Science University of Maryland, College Park Model-View-Controller (MVC) Model for GUI programming (Xerox

More information

Module 5 Applets About Applets Hierarchy of Applet Life Cycle of an Applet

Module 5 Applets About Applets Hierarchy of Applet Life Cycle of an Applet About Applets Module 5 Applets An applet is a little application. Prior to the World Wide Web, the built-in writing and drawing programs that came with Windows were sometimes called "applets." On the Web,

More information

APPENDIX. public void cekroot() { System.out.println("nilai root : "+root.data); }

APPENDIX. public void cekroot() { System.out.println(nilai root : +root.data); } APPENDIX CLASS NODE AS TREE OBJECT public class Node public int data; public Node left; public Node right; public Node parent; public Node(int i) data=i; PROCEDURE BUILDING TREE public class Tree public

More information

Java - Dates and Threads

Java - Dates and Threads Java - Dates and Threads Thread example Java uses threads to allow 1 event to break into another. If an action is to occur a number of times with a loop or to occur until some condition is satisfied then

More information

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Frames, GUI and events Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Introduction to Swing The Java AWT (Abstract Window Toolkit)

More information

Programmierpraktikum

Programmierpraktikum Programmierpraktikum Claudius Gros, SS2012 Institut für theoretische Physik Goethe-University Frankfurt a.m. 1 of 18 17/01/13 11:46 Java Applets 2 of 18 17/01/13 11:46 Java applets embedding Java applications

More information

RAIK 183H Examination 2 Solution. November 10, 2014

RAIK 183H Examination 2 Solution. November 10, 2014 RAIK 183H Examination 2 Solution November 10, 2014 Name: NUID: This examination consists of 5 questions and you have 110 minutes to complete the test. Show all steps (including any computations/explanations)

More information

OOP Assignment V. For example, the scrolling text (moving banner) problem without a thread looks like:

OOP Assignment V. For example, the scrolling text (moving banner) problem without a thread looks like: OOP Assignment V If we don t use multithreading, or a timer, and update the contents of the applet continuously by calling the repaint() method, the processor has to update frames at a blinding rate. Too

More information

Measurement of Earthquakes. New Mexico. Supercomputing Challenge. Final Report. April 3, Team #91. Miyamura High School

Measurement of Earthquakes. New Mexico. Supercomputing Challenge. Final Report. April 3, Team #91. Miyamura High School Measurement of Earthquakes New Mexico Supercomputing Challenge Final Report April 3, 2012 Team #91 Miyamura High School Team Members: Tabitha Hallock Sridivya Komaravolu Kirtus Leyba Jeffrey Young Teacher:

More information

CSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2015

CSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2015 CSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2015 Name: This exam consists of 6 problems on the following 6 pages. You may use your double- sided hand- written 8 ½ x 11 note sheet

More information

User interfaces and Swing

User interfaces and Swing User interfaces and Swing Overview, applets, drawing, action listening, layout managers. APIs: java.awt.*, javax.swing.*, classes names start with a J. Java Lectures 1 2 Applets public class Simple extends

More information

Chapter #1. Program to demonstrate applet life cycle

Chapter #1. Program to demonstrate applet life cycle Chapter #1. Program to demonstrate applet life cycle import java.applet.applet; import java.awt.*; public class LifeCycle extends Applet{ public void init(){ System.out.println(" init()"); public void

More information

Question 1. Show the steps that are involved in sorting the string SORTME using the quicksort algorithm given below.

Question 1. Show the steps that are involved in sorting the string SORTME using the quicksort algorithm given below. Name: 1.124 Quiz 2 Thursday November 9, 2000 Time: 1 hour 20 minutes Answer all questions. All questions carry equal marks. Question 1. Show the steps that are involved in sorting the string SORTME using

More information

Extra Credit Lab. Your job is to catch any syntax errors a user might make. Two examples follow. In the panel on the left the user has used

Extra Credit Lab. Your job is to catch any syntax errors a user might make. Two examples follow. In the panel on the left the user has used Extra Credit Lab The object of this lab is to write an applet that will take a string and check to see that it is a well defined polynomial in x. A polynomial in x, recall, is an expression of the form

More information

PART1: Choose the correct answer and write it on the answer sheet:

PART1: Choose the correct answer and write it on the answer sheet: PART1: Choose the correct answer and write it on the answer sheet: (15 marks 20 minutes) 1. Which of the following is included in Java SDK? a. Java interpreter c. Java disassembler b. Java debugger d.

More information

Multithread Computing

Multithread Computing Multithread Computing About This Lecture Purpose To learn multithread programming in Java What You Will Learn ¾ Benefits of multithreading ¾ Class Thread and interface Runnable ¾ Thread methods and thread

More information

17 GUI API: Container 18 Hello world with a GUI 19 GUI API: JLabel 20 GUI API: Container: add() 21 Hello world with a GUI 22 GUI API: JFrame: setdefau

17 GUI API: Container 18 Hello world with a GUI 19 GUI API: JLabel 20 GUI API: Container: add() 21 Hello world with a GUI 22 GUI API: JFrame: setdefau List of Slides 1 Title 2 Chapter 13: Graphical user interfaces 3 Chapter aims 4 Section 2: Example:Hello world with a GUI 5 Aim 6 Hello world with a GUI 7 Hello world with a GUI 8 Package: java.awt and

More information

Graphic User Interfaces. - GUI concepts - Swing - AWT

Graphic User Interfaces. - GUI concepts - Swing - AWT Graphic User Interfaces - GUI concepts - Swing - AWT 1 What is GUI Graphic User Interfaces are used in programs to communicate more efficiently with computer users MacOS MS Windows X Windows etc 2 Considerations

More information

CS 3331 Advanced Object-Oriented Programming Final Exam

CS 3331 Advanced Object-Oriented Programming Final Exam Fall 2015 (Thursday, December 3) Name: CS 3331 Advanced Object-Oriented Programming Final Exam This test has 5 questions and pages numbered 1 through 10. Reminders This test is closed-notes and closed-book.

More information

Advanced Java Unit 6: Review of Graphics and Events

Advanced Java Unit 6: Review of Graphics and Events Advanced Java Unit 6: Review of Graphics and Events This is a review of the basics of writing a java program that has a graphical interface. To keep things simple, all of the graphics programs will follow

More information

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall (total 7 pages)

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall (total 7 pages) 1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall 2002 (total 7 pages) Name: TA s Name: Tutorial: For Graders Question 1 Question 2 Question 3 Total Problem 1 (20 points) True or

More information

Introduction This assignment will ask that you write a simple graphical user interface (GUI).

Introduction This assignment will ask that you write a simple graphical user interface (GUI). Computing and Information Systems/Creative Computing University of London International Programmes 2910220: Graphical Object-Oriented and Internet programming in Java Coursework one 2011-12 Introduction

More information

Day before tests of Java Final test. IDM institution of Bandarawela. Project for department of education

Day before tests of Java Final test. IDM institution of Bandarawela. Project for department of education Day before tests of Java Final test. IDM institution of Bandarawela Project for department of education import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Doenets extends JApplet

More information

import java.awt.*; import java.applet.*; import java.awt.event.*; import java.lang.*; import java.io.*; import java.util.*; import java.net.

import java.awt.*; import java.applet.*; import java.awt.event.*; import java.lang.*; import java.io.*; import java.util.*; import java.net. // TimeClient.java - NETWORK CLOCK CLIENT // // MODULE INDEX // NAME CONTENTS // getservertime Get the current time from the server // getservertimerange Get server time range // getcurrenttimerange Adjust

More information

Swing - JLabel. Adding a text (and HTML) labels to a GUI

Swing - JLabel. Adding a text (and HTML) labels to a GUI Swing - JLabel Adding a text (and HTML) labels to a GUI Prerequisites - before this lecture You should have seen: The lecture on JFrame The lecture on JButton The lectuer on JTextField Including having

More information

We have several alternatives now, which we need to address. Here is a list of them: 1. How to get HTML interpreted correctly.

We have several alternatives now, which we need to address. Here is a list of them: 1. How to get HTML interpreted correctly. Applets in Java using NetBeans as an IDE Creating an Interactive Browser using JEditorPane (Part 3) C.W. David Department of Chemistry University of Connecticut Storrs, CT 06269-3060 Carl.David@uconn.edu

More information

Building a GUI in Java with Swing. CITS1001 extension notes Rachel Cardell-Oliver

Building a GUI in Java with Swing. CITS1001 extension notes Rachel Cardell-Oliver Building a GUI in Java with Swing CITS1001 extension notes Rachel Cardell-Oliver Lecture Outline 1. Swing components 2. Building a GUI 3. Animating the GUI 2 Swing A collection of classes of GUI components

More information

Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks)

Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks) M257 MTA Spring2010 Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks) 1. If we need various objects that are similar in structure, but

More information

JAVA NOTES GRAPHICAL USER INTERFACES

JAVA NOTES GRAPHICAL USER INTERFACES 1 JAVA NOTES GRAPHICAL USER INTERFACES Terry Marris 24 June 2001 5 TEXT AREAS 5.1 LEARNING OUTCOMES By the end of this lesson the student should be able to understand how to get multi-line input from the

More information

CSE 8A Lecture 12. Reading for next class: : Sounds! Today s topics: Logical Operators:! && Start PSA 6: Chromakey!

CSE 8A Lecture 12. Reading for next class: : Sounds! Today s topics: Logical Operators:! && Start PSA 6: Chromakey! CSE 8A Lecture 12 Reading for next class: 8.1-8.3: Sounds! Today s topics: Logical Operators:! && Start PSA 6: Chromakey! A vote for CSE 8A Yen Chuan (Allen) Liu and Pin (Arthur) Chu 1) Solo: (30 sec)

More information

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008 Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008 Announcements A3 is up, due Friday, Oct 10 Prelim 1 scheduled for Oct 16 if you have a conflict, let us know now 2 Interactive

More information

What Is an Event? Some event handler. ActionEvent. actionperformed(actionevent e) { }

What Is an Event? Some event handler. ActionEvent. actionperformed(actionevent e) { } CBOP3203 What Is an Event? Events Objects that describe what happened Event Sources The generator of an event Event Handlers A method that receives an event object, deciphers it, and processes the user

More information

Theory Test 3A. University of Cape Town ~ Department of Computer Science. Computer Science 1016S ~ For Official Use

Theory Test 3A. University of Cape Town ~ Department of Computer Science. Computer Science 1016S ~ For Official Use Please fill in your Student Number and, optionally, Name. For Official Use Student Number : Mark : Name : Marker : University of Cape Town ~ Department of Computer Science Computer Science 1016S ~ 2007

More information

Points Missed on Page page 1 of 8

Points Missed on Page page 1 of 8 Midterm II - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total. Name: ID: Problem #1 (8 points) Rewrite the following code segment using a for loop instead of a while loop (that is

More information

Java for Interfaces and Networks

Java for Interfaces and Networks Java for Interfaces and Networks Threads and Networking Federico Pecora School of Science and Technology Örebro University federico.pecora@oru.se Federico Pecora Java for Interfaces and Networks Lecture

More information

Java. GUI building with the AWT

Java. GUI building with the AWT Java GUI building with the AWT AWT (Abstract Window Toolkit) Present in all Java implementations Described in most Java textbooks Adequate for many applications Uses the controls defined by your OS therefore

More information

COMP30112: Concurrency Topics 4.1: Concurrency Patterns - Monitors

COMP30112: Concurrency Topics 4.1: Concurrency Patterns - Monitors COMP30112: Concurrency Topics 4.1: Concurrency Patterns - Monitors Howard Barringer Room KB2.20: email: Howard.Barringer@manchester.ac.uk February 2009 Outline Monitors FSP Models-to-Java Monitors Producers/Consumers

More information

Methods (Deitel chapter 6)

Methods (Deitel chapter 6) Methods (Deitel chapter 6) 1 Plan 2 Introduction Program Modules in Java Math-Class Methods Method Declarations Argument Promotion Java API Packages Random-Number Generation Scope of Declarations Methods

More information

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1 Datenbank-Praktikum Universität zu Lübeck Sommersemester 2006 Lecture: Swing Ho Ngoc Duc 1 Learning objectives GUI applications Font, Color, Image Running Applets as applications Swing Components q q Text

More information

Methods (Deitel chapter 6)

Methods (Deitel chapter 6) 1 Plan 2 Methods (Deitel chapter ) Introduction Program Modules in Java Math-Class Methods Method Declarations Argument Promotion Java API Packages Random-Number Generation Scope of Declarations Methods

More information

2018/2/5 话费券企业客户接入文档 语雀

2018/2/5 话费券企业客户接入文档 语雀 1 2 2 1 2 1 1 138999999999 2 1 2 https:lark.alipay.com/kaidi.hwf/hsz6gg/ppesyh#2.4-%e4%bc%81%e4%b8%9a%e5%ae%a2%e6%88%b7%e6%8e%a5%e6%94%b6%e5%85%85%e5 1/8 2 1 3 static IAcsClient client = null; public static

More information

d. If a is false and b is false then the output is "ELSE" Answer?

d. If a is false and b is false then the output is ELSE Answer? Intermediate Level 1) Predict the output for the below code: public void foo( boolean a, boolean b) if( a ) System.out.println("A"); if(a && b) System.out.println( "A && B"); if (!b ) System.out.println(

More information

Class 34: Introduction to Threads

Class 34: Introduction to Threads Introduction to Computation and Problem Solving Class 34: Introduction to Threads Prof. Steven R. Lerman and Dr. V. Judson Harward What is a Thread? Imagine a Java program that is reading large files over

More information

GUI in Java TalentHome Solutions

GUI in Java TalentHome Solutions GUI in Java TalentHome Solutions AWT Stands for Abstract Window Toolkit API to develop GUI in java Has some predefined components Platform Dependent Heavy weight To use AWT, import java.awt.* Calculator

More information

RAIK 183H Examination 2 Solution. November 11, 2013

RAIK 183H Examination 2 Solution. November 11, 2013 RAIK 183H Examination 2 Solution November 11, 2013 Name: NUID: This examination consists of 5 questions and you have 110 minutes to complete the test. Show all steps (including any computations/explanations)

More information

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide Topics for Exam 2: Queens College, CUNY Department of Computer Science CS 212 Object-Oriented Programming in Java Practice Exam 2 CS 212 Exam 2 Study Guide Linked Lists define a list node define a singly-linked

More information

Java Help Files. by Peter Lavin. May 22, 2004

Java Help Files. by Peter Lavin. May 22, 2004 Java Help Files by Peter Lavin May 22, 2004 Overview Help screens are a necessity for making any application user-friendly. This article will show how the JEditorPane and JFrame classes, along with HTML

More information

CS 170 Java Programming 1. Week 9: Learning about Loops

CS 170 Java Programming 1. Week 9: Learning about Loops CS 170 Java Programming 1 Week 9: Learning about Loops What s the Plan? Topic 1: A Little Review ACM GUI Apps, Buttons, Text and Events Topic 2: Learning about Loops Different kinds of loops Using loops

More information

NITI NITI I PRIORITET

NITI NITI I PRIORITET NITI public class ThreadsTest { public static void main(string args[]) { BytePrinter bp1 = new BytePrinter(); BytePrinter bp2 = new BytePrinter(); BytePrinter bp3 = new BytePrinter(); bp1.start(); bp2.start();

More information

Java for Interfaces and Networks (DT3029)

Java for Interfaces and Networks (DT3029) Java for Interfaces and Networks (DT3029) Lecture 3 Threads and Networking Federico Pecora federico.pecora@oru.se Center for Applied Autonomous Sensor Systems (AASS) Örebro University, Sweden Capiscum

More information

The first version of the bank will look like this:

The first version of the bank will look like this: Lecture 16 The Bank The first version of the bank will look like this: The user will be able to make a deposit, and the result will be reflected in several fields. In addition if the user makes a second

More information

Decisions: Logic Java Programming 2 Lesson 7

Decisions: Logic Java Programming 2 Lesson 7 Decisions: Logic Java Programming 2 Lesson 7 In the Java 1 course we learned about if statements, which use booleans (true or false) to make decisions. In this lesson, we'll dig a little deeper and use

More information

DEMYSTIFYING PROGRAMMING: CHAPTER FOUR

DEMYSTIFYING PROGRAMMING: CHAPTER FOUR DEMYSTIFYING PROGRAMMING: CHAPTER FOUR Chapter Four: ACTION EVENT MODEL 1 Objectives 1 4.1 Additional GUI components 1 JLabel 1 JTextField 1 4.2 Inductive Pause 1 4.4 Events and Interaction 3 Establish

More information

Chapter 13 Lab Advanced GUI Applications Lab Objectives. Introduction. Task #1 Creating a Menu with Submenus

Chapter 13 Lab Advanced GUI Applications Lab Objectives. Introduction. Task #1 Creating a Menu with Submenus Chapter 13 Lab Advanced GUI Applications Lab Objectives Be able to add a menu to the menu bar Be able to use nested menus Be able to add scroll bars, giving the user the option of when they will be seen.

More information

Chapter 13 Lab Advanced GUI Applications

Chapter 13 Lab Advanced GUI Applications Gaddis_516907_Java 4/10/07 2:10 PM Page 113 Chapter 13 Lab Advanced GUI Applications Objectives Be able to add a menu to the menu bar Be able to use nested menus Be able to add scroll bars, giving the

More information

MIT AITI Swing Event Model Lecture 17

MIT AITI Swing Event Model Lecture 17 MIT AITI 2004 Swing Event Model Lecture 17 The Java Event Model In the last lecture, we learned how to construct a GUI to present information to the user. But how do GUIs interact with users? How do applications

More information

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Information Science and Engineering

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Information Science and Engineering INTERNAL ASSESSMENT TEST 2 Date : 28-09-15 Max Marks :50 Subject & Code : JAVA&J2EE(10IS753) Section: VII A&B Name of faculty : Mr.Sreenath M V Time : 11.30-1.00 PM Note: Answer any five questions 1) a)

More information

UNIT-3 : MULTI THREADED PROGRAMMING, EVENT HANDLING. A Multithreaded program contains two or more parts that can run concurrently.

UNIT-3 : MULTI THREADED PROGRAMMING, EVENT HANDLING. A Multithreaded program contains two or more parts that can run concurrently. UNIT-3 : MULTI THREADED PROGRAMMING, EVENT HANDLING 1. What are Threads? A thread is a single path of execution of code in a program. A Multithreaded program contains two or more parts that can run concurrently.

More information

JApplet. toy example extends. class Point { // public int x; public int y; } p Point 5.2. Point. Point p; p = new Point(); instance,

JApplet. toy example extends. class Point { // public int x; public int y; } p Point 5.2. Point. Point p; p = new Point(); instance, 35 5 JApplet toy example 5.1 2 extends class Point { // public int x; public int y; Point x y, 5.2 Point int Java p Point Point p; p = new Point(); Point instance, p Point int 2 36 5 Point p = new Point();

More information

encompass a group of features for building Graphical User Interfaces (GUI).

encompass a group of features for building Graphical User Interfaces (GUI). Java GUI (intro) JFC Java Foundation Classes encompass a group of features for building Graphical User Interfaces (GUI). javax.swing.* used for building GUIs. Some basic functionality is already there

More information

The uscope Getting started

The uscope Getting started Introduction (fw 6.01) The uscope Getting started The uscope! A single channel, pocket-sized, digital storage oscilloscope that s small, quick, and powerful. Automotive presets get you going quickly. Ideal

More information

agentmom User's Manual

agentmom User's Manual July 2000 agentmom User's Manual Scott A. DeLoach GRADUATE SCHOOL OF ENGINEERING AND MANAGEMENT AIR FORCE INSTITUTE OF TECHNOLOGY WRIGHT-PATTERSON AIR FORCE BASE, OHIO Approved for public release; distribution

More information

Object Oriented Programming 2012/13. Final Exam June 27th, 2013

Object Oriented Programming 2012/13. Final Exam June 27th, 2013 Object Oriented Programming 2012/13 Final Exam June 27th, 2013 Directions (read carefully): CLEARLY print your name and ID on every page. The exam contains 8 pages divided into 4 parts. Make sure you have

More information

!"# $ %&# %####' #&() % # # # #&* # ## +, # -

!# $ %&# %####' #&() % # # # #&* # ## +, # - By Pep Jorge @joseplluisjorge Steema Software July 213!"# $ %&# %####' #&() % # # # #&* # ## +, # -. / " - $- * 11 1 1$ 2 11 1 3 4 / $ 5 5,+67 +68$ Copyright 213 Steema Software SL. Copyright Information.

More information

Swing - JTextField. Adding a text field to the main window (with tooltips and all)

Swing - JTextField. Adding a text field to the main window (with tooltips and all) Swing - JTextField Adding a text field to the main window (with tooltips and all) Prerequisites - before this lecture You should have seen: The lecture on JFrame The lecture on JButton Including having

More information

CS193k, Stanford Handout #16

CS193k, Stanford Handout #16 CS193k, Stanford Handout #16 Spring, 99-00 Nick Parlante Practice Final Final Exam Info Our regular exam time is Sat June 3rd in Skilling Aud (our regular room) from 3:30-5:30. The alternate will be Fri

More information

A sample print out is: is is -11 key entered was: w

A sample print out is: is is -11 key entered was: w Lab 9 Lesson 9-2: Exercise 1, 2 and 3: Note: when you run this you may need to maximize the window. The modified buttonhandler is: private static class ButtonListener implements ActionListener public void

More information

GUI and its COmponent Textfield, Button & Label. By Iqtidar Ali

GUI and its COmponent Textfield, Button & Label. By Iqtidar Ali GUI and its COmponent Textfield, Button & Label By Iqtidar Ali GUI (Graphical User Interface) GUI is a visual interface to a program. GUI are built from GUI components. A GUI component is an object with

More information

Arrays of Buttons. Inside Android

Arrays of Buttons. Inside Android Arrays of Buttons Inside Android The Complete Code Listing. Be careful about cutting and pasting.

More information

protected void printserial() { System.out.println("> NO." + this.serialno); this.serialno++; }

protected void printserial() { System.out.println(> NO. + this.serialno); this.serialno++; } NumberedTicketGenerator.java package j2.exam.ex01; public abstract class NumberedTicketGenerator { protected int serialno; public NumberedTicketGenerator() { super(); this.serialno = 1000; public void

More information

CS Exam 3 - Spring 2010

CS Exam 3 - Spring 2010 CS 1316 - Exam 3 - Spring 2010 Name: Grading TA: Section: INTEGRITY: By taking this exam, you pledge that this is your work and you have neither given nor received inappropriate help during the taking

More information

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question) CS/B.TECH/CSE(New)/SEM-5/CS-504D/2013-14 2013 OBJECT ORIENTED PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers

More information

CORBA Java. Java. Java. . Java CORBA. Java CORBA (RMI) CORBA ORB. . CORBA. CORBA Java

CORBA Java. Java. Java. . Java CORBA. Java CORBA (RMI) CORBA ORB. . CORBA. CORBA Java CORBA Java?? OMG CORBA IDL C, C++, SmallTalk, Ada Java COBOL, ORB C Ada Java C++ CORBA Java CORBA Java (RMI) JDK12 Java CORBA ORB CORBA,, CORBA? CORBA,,, CORBA, CORBA CORBA Java (, ) Java CORBA Java :

More information

import javax.swing.*; import java.awt.*; import java.awt.event.*;

import javax.swing.*; import java.awt.*; import java.awt.event.*; I need to be walked through with why the stocks are being recognized "half way." They will print out in the console but won't be recognized by certain code. Every line of code seems to look right and that's

More information

The uscope Getting started

The uscope Getting started Introduction (fw 5.11) AES uscope Manual The uscope Getting started The uscope! A single channel, pocket-sized, digital storage oscilloscope that s small, quick, and powerful. Automotive presets get you

More information

Applet which displays a simulated trackball in the upper half of its window.

Applet which displays a simulated trackball in the upper half of its window. Example: Applet which displays a simulated trackball in the upper half of its window. By dragging the trackball using the mouse, you change its state, given by its x-y position relative to the window boundaries,

More information

JAVA NOTES GRAPHICAL USER INTERFACES

JAVA NOTES GRAPHICAL USER INTERFACES 1 JAVA NOTES GRAPHICAL USER INTERFACES Terry Marris July 2001 8 DROP-DOWN LISTS 8.1 LEARNING OUTCOMES By the end of this lesson the student should be able to understand and use JLists understand and use

More information

Java Coordinate System

Java Coordinate System Java Graphics Drawing shapes in Java such as lines, rectangles, 3-D rectangles, a bar chart, or a clock utilize the Graphics class Drawing Strings Drawing Lines Drawing Rectangles Drawing Ovals Drawing

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC124, WINTER TERM, 2009 FINAL EXAMINATION 7pm to 10pm, 18 APRIL 2009, Dunning Hall Instructor: Alan McLeod If the

More information

2.4 Input and Output. Input and Output. Standard Output. Standard Output Abstraction. Input devices. Output devices. Our approach.

2.4 Input and Output. Input and Output. Standard Output. Standard Output Abstraction. Input devices. Output devices. Our approach. Input and Output 2.4 Input and Output Input devices. Keyboard Mouse Storage Network Digital camera Microphone Output devices. Display Speakers Storage Network Printer MP3 Player Today's goal: process huge

More information

Model Requirements and JAVA Programs MVP 2 1

Model Requirements and JAVA Programs MVP 2 1 Model Requirements and JAVA Programs MVP 2 1 Traditional Software The Waterfall Model Problem Area Development Analysis REVIEWS Design Implementation Costly wrt time and money. Errors are found too late

More information

Java - Applications. The following code sets up an application with a drop down menu, as yet the menu does not do anything.

Java - Applications. The following code sets up an application with a drop down menu, as yet the menu does not do anything. Java - Applications C&G Criteria: 5.3.2, 5.5.2, 5.5.3 Java applets require a web browser to run independently of the Java IDE. The Dos based console applications will run outside the IDE but have no access

More information

SINGLE EVENT HANDLING

SINGLE EVENT HANDLING SINGLE EVENT HANDLING Event handling is the process of responding to asynchronous events as they occur during the program run. An event is an action that occurs externally to your program and to which

More information

1 Short Answer (10 Points Each)

1 Short Answer (10 Points Each) Name: Write all of your responses on these exam pages. 1 Short Answer (10 Points Each) 1. What is the difference between a compiler and an interpreter? Also, discuss how Java accomplishes this task. 2.

More information

CHAPTER 2. Java Overview

CHAPTER 2. Java Overview Networks and Internet Programming (0907522) CHAPTER 2 Java Overview Instructor: Dr. Khalid A. Darabkh Objectives The objectives of this chapter are: To discuss the classes present in the java.awt package

More information

John Cowell. Essential Java Fast. How to write object oriented software for the Internet. with 64 figures. Jp Springer

John Cowell. Essential Java Fast. How to write object oriented software for the Internet. with 64 figures. Jp Springer John Cowell Essential Java Fast How to write object oriented software for the Internet with 64 figures Jp Springer Contents 1 WHY USE JAVA? 1 Introduction 1 What is Java? 2 Is this book for you? 2 What

More information

CS193j, Stanford Handout #21. Threading 3

CS193j, Stanford Handout #21. Threading 3 CS193j, Stanford Handout #21 Summer, 2003 Manu Kumar Threading 3 Thread Challenge #2 -- wait/ Co-ordination Synchronization is the first order problem with concurrency. The second problem is coordination

More information

Example: Building a Java GUI

Example: Building a Java GUI Steven Zeil October 25, 2013 Contents 1 Develop the Model 2 2 Develop the layout of those elements 3 3 Add listeners to the elements 9 4 Implement custom drawing 12 1 The StringArt Program To illustrate

More information

Java JavaBeans JavaBeans Builder (vitsual) Java JavaBeans JavaBeans http://java.sun.com/j2se/1.3/ja/docs/ja/guide/beans/ http://java.sun.com/products/javabeans/software/bdk_download.html Beans Development

More information