Java Applets in Physics
(Table of the Nuclides)
Rossen Angelouv Radev
GSI Student Program
Tutor: Peter Malzacher
Java is a new programming language for networking computers which was developed
between 1990 and 1995. In this language programs can be written which are
available via Internet, can be downloaded and executed on the users machine.
To perform this the program code must run machine-independently since there
are a lot of types of computers involved in the Internet. Java is: A simple,
object-oriented, distributed, interpreted, robust, secure, architecture
neutral, portable, high-performance, multithreaded, and dynamic language.
There are two kinds of Java-programs: applets and applications.
Applets are programs which run embedded in a WWW-side.
To run them one needs a Java-capable Web-browser.
Java is an interpreted language, so it is never going to be as fast as
a compiled language. (E.g. Java is about 20 times slower as C.) Therefore
it is unsuitable to be used for scientific computation. But this speed
is quite adequate to run interactive, Graphical User Interface (GUI) and
network-based applications, where the application is often idle, waiting
for the user to do something, or waiting for date from the network.
Applications are independent -stand alone- runnable programs
just as programs written in other computer languages. To run them a byte-code
interpreter (java) is needed.
My work at Student Program was to learn the syntax of Java and
try to make a interactive Applet -"Table of the Nuclides". To performe
this, I used the examples found in the Java Tutorial of Sun [3b]
and in the books [1a], [2a], [1b],
[2b] and [4b].
There are lot of examples available on the Internet [1c],
2. Steps to a Java Applet
By writing an applet the Java source code is to create at first.
It is a simple text file with the extension ".java".
From the source code the Java compiler creates the Java byte code
with the extension ".class" which can be run by the interpreter.
The third step is to create an HTML-source code with the "<APPLET>"-
tag, with the extension ".html":
<APPLET CODE="PaintTable.class" WIDTH=1000 HEIGHT=600>
<PARAM NAME="database" VALUE="http://www.gsi.de/~dvalpha/catalog.log">
3. Applet "PaintTable"
During my Java-studies I develop an applet modeling the interactive
"Table of the Nuclides" [2c].
To paint the Nuclides I use the data file extracted from "Evaluated
Nuclear Structure Data File" [3a], [4a].
To performe this I create Unix Shell scripts, that extract information
from different data files and make one big file (catalog.log) containing
all necessary data.
Applet PaintTable read data from catalog.log file, calculate the position,
and paint nuclides on the screen.
There a three functions available:
a) Zoom In: Table is "click able", and if user click
in the table, applet show more information from selected region.
b) Zoom Up: This is reverse of the Zoom In function.
c) Reset: This function reset Table to start position.
Applet paint nuclide name, atomic number A, and color (not available
When mouse is positioned to table, applet show in the bottom status
line of Netscape screen the number of neutrons N, protons Z, and the atomic
number A of current nuclide [fig. 1].
4. PaintTable.java - Program Structure
||A helper class. Define data for one Nuclide.
class. Define Data Types and Paint Methods.
||Initialize the table, open Input Stream, read data from file.
||Paint all table elements and labels.
|mouseUp(), mouseDoun(), mouseMove(), action()
||Mouse action events.
||Paint nuclide and table label.
The development of the PaintTable Applet and Shell scripts has been finished,
bat in future development it is possible to create applet, that make Graphical
User Interface (GUI) to all data contained in "Evaluated Nuclear Structure
Now Apllet PaintTable is available in my page in GSI-Web Server :
Flanagan, Java in a Nutshell, O'Reilly & Associates Inc.
Budd, An introduction to Object-Oriented Programing,
Addison Wesley Inc (1997) .
B. Firestone, Table of Isotopes, Wiley Interscience (1996).
Evaluated Nuclear Structure Data File, National Nuclear Data Center
Edition Using Java, 2nd Edition - Online Version,
Macmillan Publishing USA (1997).
Flanagan, Java in a Nutshell,1st Edition - Online Version,
O'Reilly & Associates Publishing (1996).
Campione, Kathy Walrath, The Java Tutorial - Object Oriented
programming for the Internet,
Online Version (1997)
Development Kit 1.1.4 Documentation, Sun Microsystems (1997) .
of the Nuclides.
Radev, Chart of the Nuclides.
Online Physics Java Applets and VRML Resources .
Frohlich, Neural networks with Java (1997).
1% Java Resources.