Class 2 - SMU

guitarchanceΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 4 μήνες)

314 εμφανίσεις

CLASS 6



EVENT HANDLING

BREAKOUT 1

1)

Read the background material for exercise 4.12 on page 83 (up to step A).

2)

Download from
http://engr.smu.edu/cse/1340/honors the file
Tutorial04.zip

to your class directory

3)

Unzip the file. It should contain one Java
source file.

4)

Open NetBeans and create a new project.

a)

Create a new project called
Tutorial04

by choosing “New Project” from the
file menu.

b)

Under Categories, choose Java. Under project, choose Java Application.

c)

Click Next then enter the project name in t
he appropriate text field. Be sure
to uncheck “Create Main Class”.

d)

Click Finish. The project should appear in your project explorer on the left of
your screen.

5)

Create a new Java source file.

a)

From the File menu, choose “New File”. In the dialog that app
ears, choose
category
Java

and File Type
“Empty Java File”.

Click Next.

b)

Enter the class name of
Counter
.

c)

Click Finish.

d)

Expand the tree in your project explorer to locate the file you just created.

6)

Open the Counter.java file you downloaded in the zip
file from step 1 in a text
editor on your computer. (Notepad for Windows, Textpad for Mac).

7)

Copy and paste all of the source code from the text editor into NetBeans in the
Counter.java file. It should be opened appropriately in NetBeans.

8)

Run the file at

this point to ensure that everything is working. Program should
look like this:



9)

Begin with Step F on page 84 of your text and complete the application.