IBM

Spectrum application

This is a simple example of a stand-alone windowed application; when started, it displays a 'frame window' on the desktop and fills it with a spectrum of colors.

Here's the source, as a plain ASCII file.

To run the program, create or copy the 'Spectrum.nrx' file (note the first letter is a capital letter), and then enter the commands:

  java COM.ibm.netrexx.process.NetRexxC Spectrum
  java Spectrum
(if on OS/2, use the single command
  netrexxc -runpm spectrum
so OS/2 will know this is a windowed application).

This would:

  1. Call the NetRexx translator to translate the program from NetRexx to Java
  2. Call the Java compiler (javac) to compile the program into a class file
  3. Call the Java interpreter (java, or javapm on OS/2) to interpret the class file, which should then display the spectrum. You can try resizing the window to watch it redrawing the spectrum, or close it in the same way as other desktop applications.

If you would like to try it without compiling it first, here's the class file. Download this by clicking on the link, then change to the directory where you placed the class file and then run

  java Spectrum
(if on OS/2, use
  javapm Spectrum
so OS/2 will know this is a windowed application).

Note that you need the capital letter in this case, as the java (and javapm) commands are case-sensitive.

Note also that the Java runtime (e.g., from the Java Development Kit) must be installed.


[ NetRexx | IBM home page | Search | Contact IBM | Help | Legal ]

This page was created on 18 Feb 1997; it can be found from http://www2.hursley.ibm.com/netrexx/