1. In the shapes program, presented in the text, add a new shape – a straight line – to the collection of available shapes. Use the library method drawLine actually to draw a line object. Add code to create a line object, add it to the list of objects (in the array list) and display it along with the other shapes.
2. Enhance the shapes program into a full-blown drawing package that allows shapes to be selected from a menu and placed at a desired location in a panel. The user specifies the position with a mouse-click. So the user:
1. First clicks somewhere in the panel.
2. Then clicks on the desired menu item.
Provide a ‘clear’ button.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here