I'm creating a program which send the content of an ArrayList from client to server. The ArrayList is the content of points drawn on a canvas, which means it constantly gets updated as the user draws. However when I draw for a longer period of time (few seconds), I get following error:
I believe the error occurs because of the ArrayList trying to override an ArrayList that is already sending (or at least some sort of override). Reasoned the error only happens if I draw while my main
thread is sending a package.
What I've tried:
- Creating a mouseReleased adapter, where the OutputStream only is active when the user isn't drawing
- Binding a button to activate the OutputStream
With both attemps I've failed to achieve success, so I would like some help to work out how this would be done most effeciently, to remove this error.
My client: