Software for spatially-explicit simulation of forest dynamics

Java Windows

Many of the Java windows are fairly complicated, but make sense once you know what's going on. If you're new to Java window construction and are looking at SORTIE window code, it may be intimidating. Just ask for help.


Windows in the Java GUI are constructed from Swing components. Swing components are platform-independent GUI controls, like dialogs, buttons, edit fields, drop-down lists, etc. You can find complete Swing documentation within Sun's Java tutorial.

Java development environments often contain window builders to help with component layout. I don't use them personally. I just directly write the code that constructs windows from their components, because the code is simpler and cleaner. You are free to construct windows however you like, as long as you don't use proprietary components. It's not always easy to tell what's proprietary - but if you have to import any packages that don't start with "java." or "javax." then you're probably using proprietary components.

Windows should look nice - everything aligned and so forth - but they can be basic, plain, and functional. Simple is good.

Common elements

SORTIE windows share some common elements to make things consistent and easy to update. They are:

  • SortieFont. Use this class as the font for all your components.
  • OKCancelButtonPanel. This class automatically constructs a panel with OK, Cancel, and Help buttons.
  • Windows implement the Java ActionListener interface. The ActionListener interface is how windows respond to events like button clicks. Windows must implement this interface in order to use the OKCancelButtonPanel class. In addition, it makes it easier (I think, anyway) to find out what different buttons do.