To create a dummy paint application using Java. Using the application, users can
ID: 3560696 • Letter: T
Question
To create a dummy paint application using Java. Using the application, users can type some text, draw
basic shapes such as rectangles and circles, and traces. And the user is able to change the color and the
thickness of borders and lines.
The requirements are summarized as follows:
1. The application should allow for paint functionality such as drawing rectangles and circles using
brushes.
a. In case of rectangles, the application should display a dialog to allow the user to enter
the height and the width of the rectangle, and also display a color picker using
JColorChooser. The coordinates of the upper-left corner is obtained when the user
clicks on the drawing surface {the client area of the frame or panel)
b. In case of circles, the application should display a dialog to allow the user to enter the
diameter of the circle, and also display a color picker using JColorChooser. The
coordinates of the center of the circle is obtained when the user clicks on the drawing
surface {the client area of the frame or panel)
2. The application can also trace the movements of a mouse by drawing lines connecting the
positions of mouse clicks. The application should also display a dialog to allow the user to specify
the thickness and the color of the line.
3. The application should provide menus from which users may choose all the preceding options.
4. The application should allow the user to save, and open the document. The file should be a
simple text file that stores the attributes of the various shapes or traces.
a. Circle: center, diameter, color e.g. 20, 30, 100, yellow
b. Rectangle: upper-left coordinates, width, height, color e.g. 10, 10, 500, 200, blue
c. Trace: line thickness, color, a sequence of points e.g. 2, green, 10, 10, 12, 13, 20, 30, 45,
55
Bonus option:
1. The application may have a bonus feature that includes text functionality, such as enabling users
to change the font name and font size, apply bold or italics, and so on.
2. The data for the text to be saved should be: the starting point, font-style, font-size, bold, italic,
and the actual string. E.g. 20, 10, arial, 12, true, false,
Explanation / Answer
Now, let us call this applet as follows:
Initially, the applet will display "initializing the applet. Starting the applet." Then once you click inside the rectangle "mouse clicked" will be displayed as well.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.