The syllabus for this course is here.
The software we will be using for this course is NetBeans 6.7. To install NetBeans on your computer you will first need to download and install the Java JDK 6. Once you have installed the JDK, you can download and install the Java edition of NetBeans 6.7.
Documentation for many of the java classes we will be using in this course is also available online at java.sun.com, or if you prefer you can download the full documentation from the Java SE Downloads page.
Here are some lecture notes covering some background material on GUI programs and the Swing classes.
I showed the first simple example of a GUI application. This example is equivalent to the example developed in the NetBeans tutorial "Introduction to GUI Building".
Reading for today is sections 13.1 through 13.9.
We covered chapter 14, Graphics. I showed another example of a GUI application based on the StillClock.java example from chapter 14.
Reading for today is sections 14.1 - 14.12.
Extend exercise 14.12 into a full GUI application with a panel to draw the plot, text fields where the user can set the bounds for the x and y axes, and plot button that the user can click to redraw the plot. This assignment is due at the start of class on Monday, Sept. 21.
Chapter 15, Event-driven programming. I showed two examples based on examples from the text, the mouse listener example and the key listener example. Reading is sections 15.1-15.5.
Other GUI elements: this material is spread over chapters 16, 33, 34, and 35. I developed a complete example that demonstrates how to use menus, dialogs, combo boxes, radio buttons, and list models. On Wednesday I also talked about the Model-View-Controller design pattern and how to build a set of interacting classes that can function as model, view, and controller. Here is an example program to show how this works, and some lecture notes that explain the structure of the example in a little more detail.
You should read sections 16.3, 16.4, 16.7, 16.8, 16.9, 33.5, 34.2, 35.7, 35.8, and 35.10.
The second programming assignment is to build a simple GUI drawing program. Here are the basic requirements:
This assignment is due by the start of class on Wednesday, Sept. 30.
Chapter 18, Exceptions, and Chapter 19, Binary Files. Here are some examples from the text to illustrate how to use Data streams, Scanners, PrintWriter, and Object streams. I also modified the example from Monday to allow you to save and open documents created in the application.
Chapter 22: the Java Collections Framework. I showed a number of the author's examples.
I talked about the java.util.Calendar class and spoke at some length about the next assignment.
The third assignment is to write an application to manage a small lending library. This assignment is due by the start of class on Friday, Oct. 9.
Chapter 29, Threads. In addition to some examples from the book, I showed an animation example. The first midterm exam is coming up on Friday, Oct. 9. Here is a list of review questions.
I started in on chapter 30, networking. Here are some simple examples from the text to demonstrate how to set up a simple client/server pair.
I showed an extended example of a network application, a simple network mail application. The project for that is here.
Write a chat application that allows multiple clients to participate in a simultaneous text chat. General guidelines for the project are
The first thing you will need to do is to construct a transcript class to represent the conversation. You should store the transcript as a list of strings. Each time a comment comes in from a client that comment will get added as a new string at the end of the transcript list.
As is usual for servers, you will be creating a thread object to manage the interaction with each client. Each time a comment arrives the thread will call an appropriate method in the transcript class to have that comment added to the transcript.
On the client side you should set up a thread that sits in an infinite loop sleeping most of the time. Each time this thread wakes up it will send a request to the server to send across any new items that have appeared in the transcript since the last time the thread sent a request. If any new lines come across in response to that request, the thread code will append that new text to the text area.
This assignment is due by the start of class on Friday, Oct. 16.
I started in on chapter 37, SQL and JDBC. We will be using the database management system MySQL in combination with NetBeans: here are some detailed instructions on how to get MySQL up and running in combination with NetBeans. Those notes also contain a simple example program that demonstrates how to use JDBC to talk to a database server.
I showed an extended example of a SQL application, the SQL mail client. Here are lecture notes and the project folder. There is a database folder inside the project folder containing the MySQL database you need to run the example.
I went over my solution to the third programming assignment and talked about some aspects of good software design.
Modify my solution to the third programming assignment to use a SQL database in place of collections and files. To do this, you will need to rewrite the methods in the Library class in my solution. You will find it most useful to create gateway classes to provide access to the tables of the database. I have included an outline of a gateway class (CheckOutGateway) in my solution. This assignment is due on Wednesday, Oct. 28.
In the next section of the course we will be working with web applications. You will need to perform some additional steps to get your development environment set up to work with web applications. Most importantly, you will need to get NetBeans configured to work the Tomcat web application server.
Unfortunately, the default installation for the edition of NetBeans we are using does not install the Tomcat web application server by default. To check whether or not you installed Tomcat when you installed NetBeans, select Services from the Window menu in NetBeans. Click the plus sign next to Servers in the Services window to expand the list of installed servers. If Tomcat does not show up on that list, you will need to install Tomcat.
There are two methods to get Tomcat installed. One method is to uninstall your existing version of NetBeans and reinstall the Java edition of NetBeans. At the start of the installation process you should see a dialog with a Customize button on it. Click that button - in the options dialog that pops up, uncheck the options to install the two bundled versions of GlassFish and check the option to install Tomcat.
The second method is to install Tomcat as a separate installation and then just link NetBeans to it. Windows users who want to install Tomcat separately should download this installer and run it to install the Tomcat service. Mac OS X users can follow the instructions at this page to get Tomcat installed. During the installation process you should be prompted to set an administrator passwork for Tomcat. Remember that password, as you will need it to link NetBeans to Tomcat. Once Tomcat is installed, go to the Services window in NetBeans and right-click on Servers. Select the option to add a new Server. In the dialog that appears, select Tomcat 6.0 as the server type you want to install and specify the location of the directory where you installed Tomcat.
You should now be ready to build and deploy web applications to Tomcat.
The web section of the course will require that you have at least a rudimentary working knowledge of HTML. If you have little or no experience with HTML, you might want to read the HTML tutorial that the author provided. For more information on HTML and HTML forms, here is an HTML tutorial and a guide to HTML forms.
I began the discussion of servlets and showed a basic first example. Reading is the first few sections of Chapter 39.
More on Java Servlets. I showed some of the servlet examples from chapter 39 that demonstrate how to use a database with servlets and use hidden fields, cookies, and sessions. You should finish reading Chapter 39.
The second midterm exam is coming up on Friday, Oct. 30. This exam will cover threads, networking, and databases. Here is a list of topics to study for the exam.
Do programming exercise 8 from the end of Chapter 39. This assignment is due on Wednesday, Nov. 4.
I covered Chapter 40, Java Server Pages. Here is a project containing some of the examples from chapter 40.
I started the discussion of Java Server Faces (JSF) and introduced the Visual Web design tools in NetBeans. I showed two introductory examples, Hello, World and a database example. Here are some lecture notes that take you step by step through the construction of these two examples. I strongly recommend that you work through these two examples by following the instructions in the lecture notes - this is the best way to learn the basics of JSF and the NetBeans Visual Web design tools.
I showed an extended example of a JSF application, a JSF mail program. I showed two versions, a basic version and an advanced version. Lecture notes covering both versions are here.
The next assignment is to create a simple auction web site using JSF and the NetBeans Visual Web design tools. Here are some specific requirements for your web application.
Your web application has to meet the minimum requirements shown here - how you organize the site to meet these requirements is up to you.
This assignment is due on Friday, Nov. 13.
Getting set up to do the final project, which will be a multi-player online game. On Wednesday we set out base parameters for the game:
On Friday, I presented UML diagrams for a rough design I had worked out for the application. You are free to use this design and modify it as you see fit.
The final project is due on the last day of classes.
I gave a couple of short bonus lectures, one on applets (example) and another on testing with JUnit (example).
I covered chapter 43, RMI. I showed a basic example based on an example from the text, and showed a more complex example of a client-server application built on RMI. Lecture notes and project files for that example are available here.
I gave a bonus lecture on Enterprise Java Beans (EJB). This is purely bonus material and will not appear on the final exam.
The final is coming up on Tuesday, Nov. 24 at 1:30. Here is a list of topics to study for the exam.