Code Archive

On this page you will find links to (hopefully) useful bits and pieces of code. Some are only templates, others are runnable mini applications, and some again are stored in jar-files, where the whole project is interesting.

Model-View-Control


A jar file containing all the files necessary to run the model-view-control example shown at one of the lectures. Try to read and understand the code, and especially how the model, the views and the controls are connected in the program.

Application Launcher

A small java file that contains the sample code necessary to initialize the three different platforms, Linux, Windows and Mac OS X. The file contains stubs for the initialization of Linux and Windows, but the necessary code used to create "real" Mac menus (i.e., attached to the screen rather than to the main window).

The code in this file is suitable as the startup package for most applications (with some modifications, of course).

Resource Loader

Basic class used to load ImageIcons from images in the class path or the file-system. This loader will first look in the class path and then in the file-system. The Author of this file is Joakim Olsson. Thanks for letting me use it.

Javadoc comments and other documentation is in the file.

Strange Window

A java file that contains a mini program that displays a window that changes color according to its sizes. It also describes a way of making sure there is a minimum size of the window.