Technical University of Denmark DTU
02115   Java Programming
Autumn 2011

Week plan #11

For the week   14. November - 18. November


Preparations for the week

The following statements on the work to be carried out have general value:


The lectures

We will cover selected parts of the BK textbook, primarily
  - Chapter 11, pages 365-380.



Exercises at the PC's

I have chosen not to suggest any specific exercises from the textbook to carry out because you will probably think on the GUI to be made for the Mandatory Assignment.

The link on page 375 of BK referring to the Java Tutorial Creating a GUI with JFC/Swing has been changed into http://download.oracle.com/javase/tutorial/uiswing
Just click on this new link here:
    Creating a GUI With JFC/Swing

Instead experiment with the types of components you have in mind to use in the Mandatory Assignment based primarily on what is presented in the sections 11.8 and 11.9 of our BK textbook.

You can be introduced to and guided through some useful components by doing Exercises 11.49 - 11.63


After the lectures

The lectures has not covered all details of pages 365-380 of the BK textbook. Work through the parts you find relevant for solving the Mandatory Assignment. The simplesound project shows the use of some other GUI components and how to achieve a strict Model/view separation

For objects which are elements of a collection class you have to declare a boolean equals(Object o) method in the corresponding class. For a HashSet of elements a hashCode method should be supplied. And for a HashMap the class from which the keys originate should also declare a hashCode method. To use TreeSet<T> and TreeMap<T, ...> class T should declare a int compareTo(T o) method. Refer to our two textbooks PS, primarily section 22.8, and BK section 9.8 (Object equality: equals and hashCode)


Jens Thyge Kristensen, Email: jtk@imm.dtu.dk

Newest edition:   17. October
Previous editions:
    -   8. April (just the heading and the footing)