Java(TM) Demos

Me and the Duke, what buddies! In the process of developing a Java language client to the Guide to Available Mathematical Software, HotGAMS, and participating in the JavaNumerics project, I have constructed several user interface classes as extensions to java.awt. These classes may be of use to other java programmers.

Available Packages, Demos & Bug Fixes:

Note that some widgets are using my FontMetric Patch.

The Code

jnt.FFT Fast Fourier Transform

I have developed a preliminary set of FFT routines which might be of interest. There are several useful transforms included (and several missing), but the lack of good treatment in Java of multi-dimensional arrays and Complex numbers leave the interface awkward. (see the JavaNumerics project for potential developments)

NOTE: Several routines in this subpackage were derived from Brian Gough's FFT routines in the Gnu Scientific Library (GSL). GSL is released under the Gnu General Public License; As such, this package must also be released under GPL.


TabPanel is a container for a set of tabbed cards, lying atop each other, but with the labelled tabs exposed at the top. That is, the classic Tab Folder. Each card is an awt.component or container of whatever design you wish. Cards can be selected programmatically (Using first(), last(), next(), previous(), or show(name)), or by clicking on the tab with the mouse.


ObjectList is a similar to awt.List, with the primary difference that list items can be general Objects, rather than being restricted to Strings. Along with this change, however, comes a number of additional capabilities, and possible customizations. The usual operations; adding, deleting, selecting and replacing items are supported. In addition individual items may enabled or disabled; hidden or shown. ObjectList can also support a hierarchical structure; children of an opened item are displayed, indented, below the parent. Furthermore, the display and `mouse documentation' of items may be customized. ObjectList's interface also supports items with different mouse sensitive areas.


StackLayout is a LayoutManager that stacks a set of components vertically or horizontally and handles resizing. Any named components (by using add(name,c)) are considered `stretchable'; what name is used is irrelevant. When laying out the container, all non-stretchable components get their minimum size with the remainder of the height or width divided up amongst the stretchable components.


Scroller is a scrollable container. The idea is to have a scrollable viewport into a large container with arbitrary components in it. It works tollerably well, but not quite as good as I had hoped. Still, try it out if you wish.

Java Bug Fixes

FontMetric bug

If you use FontMetrics to layout your GUI, you may have noticed some peculiarities on some platforms, .... or maybe your users have! Check out this demo and a workaround.


There is a rather nasty bug that apparently appears only in Netscape running on SunOS; the inner panel is not clipped by the viewport panel. This results in a pretty messy screen.


  1. For the uses of the Gams project, all of the `generic' user-interface classes are defined in the gui package and the Test/Demo drivers are in the test package. Those package declarations may, of course, may be removed if not needed.
  2. These programs are a "Contribution of the National Institute of Standards and Technology, not subject to copyright." However, if you wish to use them, please credit me and NIST.

Created by Bruce Miller @ NIST ( Disclaimer.