Polygon
object by defining the (x,y) coordinates of the following points:
2 |\ 0--------------1 \ | 3 6--------------5 / |/ 4
ActionListener
objects for each button, then override the paintComponent
method of the drawing area and use the Graphics2D
and AffineTransform
objects to modify the scale, rotation, and position of the arrow shape.
FocusListener
and the MouseListener
interfaces in addition to the KeyListener
interface. Once the mouse is clicked, call requestFocus()
method in order to process keyEvent
s.rotate
, scale
and translate
methods: