Question
Java JPanel questions How do you draw multiple line and square in one JPanel? how do you keep track on that x and y value
Java JPanel questions
How do you draw multiple line and square in one JPanel?
how do you keep track on that x and y value (Starting x and y value, end x and y value) when the mouse listener get call every time?
and how do you make this class implement an action listener. Please if you could explain to me what to do in the code.
In the code it should be able to draw multiple line and square with any size that mouselistener get from user, also it has to have one reset button that clear everything in jpanel.
they said have to override the paintComponent() but how do i do that? can you please give example either square or line.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started