What type of device are you using? Because I don't remember my work and home PCs being able to interact with styluses; only my old Windows Mobile phone was. Or do you mean you use a pen that's connected to your PC?
Either way, Swing and events have nothing to do with sockets or Internet protocols, so I'm moving this
thread to our GUI forum.