Right method to build a online whiteboard - JAVA
- by Nikhar Sharma
I am building a whiteboard, which would have a server(teacher) and clients(students). Teacher would draw something on his side, which will be shown exactly same to the students.
I want to know which component i should use to do the drawing? i am currently drawing on JPanel .
I want the screen of Server gets copied on the clients, so for that what could be the right method to do this?
option1: i save the JPanel as image, and send thru socket, and loads it on the screen of client, also it always saves the background image only, not what the user has drawn onto it. OR
option2: both server and client JPanel dimensions are same, so i just send the new coordinates drawn everytime thru socket, with some protocol to understand whether it is rubber or pencil..
Any help would be appreciated.