Without the TestCell class and the data it makes available I was unable to try your class.
I did observe something that might be causing some trouble. When you call the
setScale method in Drawing it scales the data in
xCells and
yCells. On the next repaint this data is
re-computed/reset in the
getDrawingData method without any scale factor. You might consider
either calling
getDrawingData only one time (you could call it again for
componentResized events) or incorporating a scale factor (member variable) in it to do the scaling.
I want to pass two 2D array to a defined method in class "Drawing" then to plot a
gemeotry. The arrays are initialized by reading a text file.
Do I pass array within init() then pass them with the events? I would try to read the data from the
applet on startup, eg, call a method in your applet
from within
init that would read the data and then pass the data to the Drawing
class through its constructor. You could use a
setData method, especially if you
plan to change the data during runtime.