The goal of this assignment is to gain exposure to Java Swing and to build a user interface with amix of standard and custom widgets. This project will involve creating a simple interactive paintapplication.1. Write a Java application that opens a UI window (hint: see the JFrame class).2. Implement a class to serve as a template for points that will be drawn to the screen.Each point can have a distinct 2D position, color, and size, so the class should have privateinstance variables to represent this state.3. Add a canvas to your window which draws points when the user clicks the canvas ordrags the mouse on the canvas (hint: see the JPanel class). To accomplish this, your applicationshould maintain an ArrayList of instances of your point class from part 2; your mouse listenersshould create instances of the class and add them to the list while your implementation of theJPanel paintComponent method should paint all point instances in the list to the screen.3. Add at least four buttons to your window which allow the user to select the currentpoint color. This point color should affect any points drawn from the time the color is selecteduntil the time that another color is selected.4. Add at least three buttons to your window which will allow the user to select the currentpoint size. This point size should affect any points drawn from the time the size is selected untilthe time that another size is selected.5. Add a clear button to your frame which, when clicked, immediately clears anything thathas been drawn to your canvas.6. Write code that is clear and efficient. Specifically, your code should be indented withrespect to code blocks, avoid unnecessarily repetitive code, avoid code that is commented outor otherwise unused, use descriptive and consistent class/method/variable names, etc.Your window should look something like:Please zip your Java source file(s), i.e., .java file(s), into a zipped file, rename that file as <YourFull Name>Assignment4.zip, e.g., BillGatesAssignment4.zip, and then upload that file toCanvas. You are free to use whatever IDEs you prefer to complete your assignment. Nopackage keyword should be used.
CIS212
[Solved] CIS 212 Assignment 4-user interface with a mix of standard and custom widgets
$25
File Name: CIS_212_Assignment_4-user_interface_with_a_mix_of_standard_and_custom_widgets.zip
File Size: 725.34 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.