CIS 226 C – Java Programming

CIS 234 C – Advanced Java Programming

Questions and Answers

Lake Arrowhead, California  

  CIS 226/234 Home   Message Board   Questions and Answers   Coding Conventions         

What's the textbook for this course?

We chose the book by Deitel and Deitel, Java How to Program 6th or 7th Edition. You may buy it from the book store, or order it online. For more information, go to http://deitel.com/books
  • CIS 226: Java Programing, teaches the basic of Java, covering Chapters 1 to 12 plus Chapter 20 (Applet).
  • CIS 234: Advanced Java Programming, teaches you how to develop Java Rich Applications, covering Chapters 11 to 22 plus Chapters 29 and 30 (Formatted Output, Strings, Characters, and Regular Expression).
  • In the near future a new course, Java Web Applications, will teach you how to develop Java Web Applications that can be accessed with thin clients (web browsers), covering Chapters 23 to 28.
  • The book contains very rich information about Java, and so can be used as a reference book when programming in Java. It comes with a CD containing the sample programs and software for this class.
  • The 6th edition is based on Java 5 while the 7th edition is based on Java 6. The difference between 6th and 7th editions are very minor for CIS 226 students. For CIS 234 students, the chapters 28 and 29 in the 6th edition become chapters 29 and 30 in the 7th edition. For the future Java Web Applications students, the 7th edition contains the latest Java Web Applications technology, such as JSF, AJAX, and JAX-WS. It doesn't cover the details of Servlet as in the 6th edition, but we'll teach it with provided class notes.
  • If you buy a new book, the 7th edition is recommended.

How to login Blackborad?

Visit http://cypresscollege.blackboard.com/webapps/login/ Enter your student ID, e.g. @12345678, as Username, and the password same as that for your WebStar. If you forget your password, click the link Forgot password?

What's the software for this course?

It is Java 2 Software Development Kit (J2SDK or JDK) version 1.5.0 or 5.0 (Sun renamed 1.5.0 to 5.0). For the Integrated Development Environment (IDE) we chose the popular open source software Eclipse. For your convenience, I prepared a CD that contains J2SDK 1.5.0 with documents, Eclipse 3.3, and the Sample Java codes. You may check out the CD from the Lab and install on your home computer. The Readme.txt on the CD contains the steps for installation.

Where do I get J2SDK?

You may install it from the book's CD, my CD, or download version 5.0 free from http://java.sun.com/javase/downloads/previous.jsp . The newest version is 6.0, which should be also OK for the class examples and your homework.

How to submit the Assignments?

After finish your assignment, submit it by the Digital Dropbox in Tools of the blackboard.

How to install Eclipse?

  1. Goto http://www.eclipse.org/downloads/index.php , download Eclipse Classic, or check out my CD from the Lab.
  2. Double click the downloaded eclipse-SDK-3.x-win32.zip, extract all files into a folder, e.g. C:\eclipse.
  3. Double click the extracted eclipse.exe .

How to create a project in Eclipse?

  1. Start Eclipse.
  2. File, New Project...
  3. In New Project wizard, select Java Project. Click Next.
  4. Enter Project name, e.g. Assign2. Uncheck Use default. Enter directory, e.g. F:\Assign2 where F is the flash memory device. Click Finish.

How to make and run an application in Eclipse?

  1. Select Java Perspective on the left vertical toolbar.
  2. In Package Explorer, select your project, e.g. Assign2.
  3. File, New Class. In the dialog, enter Name, e.g. Assign2. Click Finish.
  4. Edit the class. Click Save in the toolbar.
  5. Select menu Project, Build Project.
  6. Select menu Run, Run As, Java Application.

How to make and run an applet in Eclipse?

  1. Follow the same steps 1 to 5 as above.
  2. Select menu Run, Run As, Java Applet.

How to change the size of an applet in Eclipse?

  1. In menu Run, Run... select your project.
  2. Click the tab Parameters. Change Width and Height. Hit the button Run.

How to debug an application or an applet in Eclipse?

  1. Select menu Run, Debug As, Java Application or Java Applet.
  2. In Debug Perspective, double click in the left margin of the code window, on the line you want to break.
  3. Once the program stopped at the break point, you may select the variable, right click "Inspect" to see its value.
  4. You may select Step into, Step over, Resume, Terminate, etc. in the Debug window.

How to export and import a project in Eclipse?

You may need export and import if you do the assignment at home, and test it at the Lab.

  1. In Eclipse on one computer, File, Export...
  2. In Export wizard, select File System. Click Next.
  3. Select the projects you want to export. Enter directory of your removable disk. Click Finish.
  4. In Eclipse on another computer, File, Import...
  5. In Import wizard, select File System. Click Next.
  6. Enter From Directory on your removable disk. Click button Select All. Click Finish.

How to delete a project in Eclipse?

  1. Select the project you want to delete.
  2. Choose menu Edit, Delete.
  3. In the Confirm Project Delete dialog, select the option "Do not delete the contents". CAUTION: Never delete contents unless you are 100% sure you don't need the files.
  4. Click Yes.

How to create a package in Eclipse?

  1. In Package Explorer, select your project, e.g. Assign8.
  2. File, New Package. In the dialog, enter Name, e.g. com.deitel.jhtp5.ch08. Click Finish.
  3. Drag and drop files, e.g. Rectangle.java, into the package.
  4. Edit the java files to add package and import.

How to create a JAR file in Eclipse?

  1. In Package Explorer, select your project, e.g. Assign8.
  2. File, Export... Select JAR file, click next.
  3. Enter JAR file name, e.g. A:\Assign8.jar, click Finish.

This document was last modified by Jerry Zhou on