I’m having issues with a java class project. The first step consist in drawing a pattern, so I thought well, this can’t be hard. And it isn’t, but there one thing that really bothers me. First, check the screenshot below :
My problem is that this was done without releasing the mouse, so the drawing should be continuous. Instead of this, there’s holes in it. I’m thinking this is related to the way mouse events are transmitted, But I have no idea how to tweak this.
The drawing zone is a JPanel. There is a set of Points that is used to paint the container on mouse events. Pressing add the first point, dragging the others, released clear the drawing zone.
Hope I was specific enough. Thanks for your time!
edit : Forgot the code. http://pastebin.com/RyXiGsvm
I guess you store mouse points obtained in mouseDrag processing. Mouse drag happens from after some time interval so if you move mouse relatively fast you just got points. TO drai it you can use drawLine() passing pairs of point. So you’ll have lines.