The AtmGUI Class


The AtmGUI Class

To demonstrate the process of developing a GUI front-end to a scientific or engineering application, we will create a GUI to handle the I/O requirements of the atmospheric modeling program we developed in Chapter 25. A USatm76 object requires two input arguments, the system of units to be used and the altitude at which to compute the atmospheric conditions. Once a USatm76 object is created, the object can access methods defined in the USatm76 class to return the atmospheric conditions the object represents. The name of our GUI class will be AtmGUI.java .

The first step in the GUI design process is to select a container to hold the other GUI components. Following that, we must decide which GUI components we will use to receive the input parameters and display the output from the atmosphere modeling tool. There are two input arguments to the USatm76 constructor, so we will need two GUI components to accept the input data. The atmospheric conditions will be printed out as a series of Strings , so we need another GUI component that can display these Strings .

The AtmGUI class will also have to define a mechanism for determining when a USatm76 object should be created and its atmospheric conditions displayed on the GUI. Under the Java GUI framework this mechanism is called an event handler. There are different ways to implement event handlers. For the example in this chapter, the AtmGUI class will serve as its own event handler.



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net