Now, in this game of course, a server is required, for which every person can see what the other player is drawing.
I managed to paint from one screen to another, but the problem is that the coordinates of the drawings are not the same if the dimension (WIDTH AND HEIGHT) of the screen is different.
Here's some code to begin with:
oldX, oldY, currentX, currentY are values sent from the client
posted 5 months ago
You should never call repaint() from the paintComponent() method or from any method called by the paintComponent() method. That will cause the paintComponent() method to be called again - an infinite loop.