i have written a program in which i am drawing using a mouse. however while drawing a new line the previous ones are still being shown. i have called repaint every time the mouse is moved.
Can anyone please help.
aveek
0
Newbie Poster
Recommended Answers
Jump to PostAt the start of the paint method, call super.paintComponent. This should have the effect of clearing the screen. If it doesn't, draw a new rectangle on the screen that is the color you want (white or gray probably) that fills the whole screen.
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.