Beginning of the class named Prob10Runner

The code in the main method in Listing 10

Listing 1 shows the beginning of the class named Prob10Runner.

Listing 1 declares several instance variables

I will refer back to some of these variables in later slides.

Listing 1. Beginning of the class named Prob10Runner.
class Prob10Runner extends JFrame{

  private JPanel mainPanel = new JPanel();
  private JPanel titlePanel = new JPanel();
  
  //Instantiate a new slider setting the limits and the
  // initial position of the thumb.
  private JSlider slider = new JSlider(0,360,45);

  private Picture butterfly = new Picture("Prob10.jpg");
  private Picture background = null;

  private int butterflyWidth = butterfly.getWidth();
  private int butterflyHeight = butterfly.getHeight();

  private Picture display = null;
  private int displayWidth = 0;
  private int displayHeight = 0;

  private Image image = null;
  private Graphics graphics = null;
  private AffineTransform rotateTransform = null;
  private AffineTransform translateTransform = null;
  private Graphics2D g2 = null;

File: ar.htm [Next] [Prev]