CIT CS Workshop: June 2001

Drawing Figures in Java Applets or Frames

Colorado State University
Computer Science Department

Graphics in Java Applets or Frames

Drawing figures in Java applets or frames

Bounding Box
Every Java figure has a bounding box

The x,y coordinates of the top left corner
      of the bounding box
  determine the position of the figure

The height and width of the bounding box
  determine the maximum height and width  
      of the figure

  drawOval (xleft, ytop, width, height)

Drawing Arcs
A Java arc is determined by
  -- the curve of an oval drawn  
        within its bounding box  
  -- its starting angle
  -- and the angle of the arc
  drawArc (xleft, ytop, width, height, start_angle, arc_angle)



Copyright © 2001: Colorado State University for Computer Science. All rights reserved.