I have created a Java client server application using a socket
connection with buffered reader and print writer objects to receive and
send the data on the client and the server. The data goes to the server
and is processed but the returned string, each line of which is
tokenized on the client, should add elements to a JList. The logic of
the code loops is working OK, as the output to the screen shows the
correct elements when the event button on the client is clicked.
However, the client window freezes and there is no display of the data
in the JList on the client. When I close the server GUI, the correct
information is then displayed. I am running the application on the one
machine using local host. Any suggestions as to the potential problem
would be appreciated. I must stress that I am not an experienced java
programmer.
Andrew Thompson - 07 Jan 2007 07:16 GMT
> I have created a Java client server application
Code*?
> .... Any suggestions as to the potential problem
> would be appreciated.
I'd say the problem is the code*.
>...I must stress that I am not an experienced java
> programmer.
So.. why are you trying to write GUI'd applications**,
and why have you leaped into coding a client/server***?
* And by 'code' I am suggesting you post not just
any generic code or code snippets that you are
dealing with, but an SSCCE.
<http://www.physci.org/codes/sscce>
** Which are something that should only be approached
once you have an understanding of the underlying
core (command line/headess) Java.
*** Which is harder to debug that a client that
gets its data from a static file (for instance).
Andrew T.
mehall126 - 07 Jan 2007 14:49 GMT
> > I have created a Java client server application
>
> Code*?
I stressed that I was not an experienced programmer so that any
respondents might not assume that I had an advanced knowledge. I have
studied the components of the language required for the task so the
creation of a GUI'd client-server application is not totally beyond my
level of comprehension. I have not posted any code at this stage as I
thought that the problem may be one that others may have encountered
which might have a simple solution.
Thanks
> > .... Any suggestions as to the potential problem
> > would be appreciated.
[quoted text clipped - 18 lines]
>
> Andrew T.
Nigel Wade - 08 Jan 2007 10:09 GMT
> I have created a Java client server application using a socket
> connection with buffered reader and print writer objects to receive and
[quoted text clipped - 9 lines]
> would be appreciated. I must stress that I am not an experienced java
> programmer.
From the scraps of information in the above it looks like you have a client GUI
and a server GUI which are trying to communicate using sockets. I also see that
you are not an experienced Java programmer. This is not a good combination.
To succeed with what you are trying to do requires a detailed knowledge of how
to program networked applications with their related issues, along with
multi-threaded programming in a GUI environment.
Talk about jumping in at the deep end...

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555