• Post Reply Bookmark Topic Watch Topic
  • New Topic

Communicating client interface actions to the server

 
Mike Fox
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I'm writing a small program that takes user input from a client applet and sends it to the server where it is then processed and a response given. I set it up ok processing typed data at the command line but now I want to interpret clicks on UI components in an applet that I have created. How do I write directly to the client's output stream?

For example if a user selects the left hand-side button on my client interface, this would create the sentence "left button clicked" like a protocol and then that sentence is passed to the server. Where upon the server receiving this sentence it is processed in some way. I know how to detect the click but it is the process of getting my client to inform the server of the event that I am struggling with.

Thanks
 
Mike Fox
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bah! I've got it... my understanding was correct I was just using the wrong method. I had tried getting a PrintWriter for the client socket but had only tried using write() to send data, which doesn't work. I tried println() similar to how I had been doing it at the command line and it sends the data to the server and the server responds fine.

Cheers!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!