File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hand over number from gui to client class

 
Anders Kviback
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I have an issue here regarding streams and server - client. This is an university course and it is my absolutely last exercise. And I just can't figure out the last part . Hopefully I will be able to explain the problem without showing the whole code. The server class sends a number, for example 14 + 27. In the gUI I have a JTextField where I put in the answer, i e 41. I then click on the send button in order to send the answer to the server. (I am the client). But this sending can't be done before I click the send button. And this is my problem. In the ClientgUI it looks like this:

And in the MathClient class it looks like this:

I mean; when the program in Mathclient has reached sendAnswer(number) it must stay there and not execute further. It has to start execute further when I click on the send button. I need the number to be "handed over" from the gui class to the client class. But how shall the sendAnswer method look like?

Hopefully you can follow me here.

Anyone? Or do I have to send more code?

Anders
 
Sachin H. Gupta
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is mcn and what exactly does MathClient do ?

You can add some code in sendAnswer(number) to wait for an event and then send the code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic