Java Tech Graphics
- overview of graphics in technical programs and what Java offers
to this area.
Building a plotting
package - we will start here to develop several graphics classes
in the next few chapters that we can use for data plotting in
the programs in the rest of the course.
program here will use the abstract class PlotPanel
that extends JPanel
and provides a frame with title, horizontal label and scale values
for the axes. The subclass DemoPanel
draws data points within the frame provided by methods in PlotPanel.
The class PlotFormat
uses the DecimalFormat
class to format the axes scale numbers.
- use a histogram to illustrate the display of data on a JPanel
component. The demo
applet uses a HistPanel
component class that we will use in subsequent programs.
This component also takes advantage of the formatting
techniques discussed in Chapter
5: Tech for the display of the values on the coordinate axes.
See the PlotFormat
class. A Histogram
class provides various methods for access to and modification
of the histogram parameters and data.
Data - we look at handling the text output from the programs
within the graphical user interface. The demo
applet uses a JTextArea
Swing component to display text output from a calculation using
the Euler method to determine the position of a falling object.