您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)

 

Apply Index

Apply Page #3

Activity 3: Compilation and running of "BallWorld.java" - version 2  

(1) create a new directory called "Bounce2", to store the files for version 2 of our application

(2) copy the file "Ball.class" into this new directory

(3) open "BallWorld.java - version 2" into your Kawa editor by clicking on to the BallWorld.java Version 2 link and then open the file. The file will be displayed in the Kawa editor window.

(4) add a comment at the top of the file with your name and date

(5) save the file into your new directory, calling the file "BallWorld.java"

(6) compile the file "BallWorld.java" into bytecode

Hint: Use the Compile command from the pull down menu of Build
if the compilation is successful you will see the message

Class Path - 

.;c:\ Kawa4.01\kawaclasses.zip;c:\jdk1.3... .
File Compiled...
No Errors...

(7) check the source file has successfully compiled by looking at the contents of the directory

(8) now run the application by choosing Run from the Build pull down menu of Kawa
if you have been successful, a new window entitled "BallWorld" should have appeared, showing a filled in circle (a graphic representation of our Ball object). After about 2 seconds or so the window will have closed itself (i.e. the program terminated and closed the window).
You can change the value of the "pause(2000)" statement to speed up or slow down the execution of the application.

Discussion of Activity 3

Back to Content

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg