Ulf Dittmer wrote:I see. You will most likely still run into the problem of the server not being able to contact the receiving machine (unless they're both on the same network).
If you somehow manage to overcome that, the usual approach to finding the IP of the receiver is to have the receiver check in with the server when the app on the receiving machine starts up. Then the server will have the IP (along with some ID that the receiver had better send, so that the server knows which client/user is running on that machine).
1/How multiple client can connect with the server ?
I read about the threads but I didn't know where to put it
2/ How the server check if reciever is connected ?
So the server is a Java web app, and your app will run on the sending and receiving cell phones? Since I see Java code for the "client", is this supposed to be a JME or an Android app?
Michael Dunn wrote:you have 3 textFields, with keyListeners on each
before you type anything, their getText() would return an empty string ("")
you type a character into one of the textFields, and your code tries to parse
all 3 textFields at the same time, so when it tries to parse "", it will error
you could test for the source in your KeyListener code, but do you really
want the listener firing on each keyStroke?
A button ("Calculate") might be better suited for the user to press when all
textfields have input data.
Read your code carefully. To what container do you add the JLabel text? Does that have anything to do with the new JFrame?
Your new JFrame doesn't block input in the original frame. You need a modal JDialog for that, or easier use JOptionPane and its static methods.
Using Exception Handling, allow only numeric values to be entered for the dimensions of the shape. If the user enters a non-numeric value, a popup window (i.e., another frame) should appear with a suitable error message displayed in a large font (use JLabel for this message). Make the popup window block input in the original frame until it is closed.