Lab #3
Part A

Write an event driven Java program that will allow the user to draw a shape with the mouse and the keyboard. The container should be a JFrame. The layout manager of the frame is BorderLayout.

The shape to draw shall be determined by a KeyEvent using the following keys:
  • c draws a circle
  • o draws an oval
  • r draws a rectagle
  • l draws a line
  • t draws a triangle
The size and placement of the shape should be determined by the mousePressed and mouseReleased events.

Display the name of the current shape drawn in a JLabel in the SOUTH region of the BorderLayout. The initial shape should default to a circle. The event handler shall be a separate class.

Part B

Convert the program to a JApplet container. The JApplet shall be displayable in a browser.