Newbie swing question



Hello,

I am new to java and I started off by writing a client/server based
tic-tac-toe game using Swing. I have run myself into the following
situation.

What I am trying to do:
My server wants print a dot (.) every few seconds on its GUI text area
when it is waiting for input from the client.

How I did it:
I have timeout set on the socket from where server is reading for the
client input. Upon timeout there is an exception and my catch block
will print(try to) a dot on the server GUI text area. And then it will
again go back to reading(waiting for) the client input.

Problem:
However out of my design flaw or whatever, this whole thing about
waiting for Client input and printing the GUI, is happening in the same
GUI thread.

So the User Inputs -> Server GUIThread ->Waits for Client->Timesout and
prints to the GUI->Wait for Client->Gets Client response->Prints some
other info to the GUI

Due to this the dot(.) that i m trying to print at time out is not
flushing on the GUI screen until the server gets the response from the
client.

Is there a way to go around this ? If no what would be a better design
for Client/Server GUI apps WRT java swing.

Thanks,
Kandarp

.



Relevant Pages

  • Re: porting curses driven to gui application
    ... > more than just replace the curses interface by a GUI. ... > don't have a X server (e.g. because they are just running Windows ... > running on the machine where the database is also running. ... > server and the client on the user side. ...
    (comp.unix.programmer)
  • How Would You Design This Application?
    ... I'm looking for some ideas on which combinations of Java language features, third party tools and design patterns would apply to the design of the following type of system subject to certain constraints as described below. ... The database is relational but the server must work with an object-oriented representation of the data therein. ... User selects an object via the GUI, enters additional data via that same GUI, and issues a synchronous add/update/delete transaction to the server upon clicking the appropriate button. ... Client app must wait for a response from the server before continuing. ...
    (comp.lang.java.programmer)
  • Re: Great SWT Program
    ... graphics; one-button mice...all while the machines have tended to be ... the internet are good enough that you can run a modern-as-of-2007 GUI ... * Remote machine has graphical app running that tells the Windows ... network to the client to display a button labeled "foo" at those ...
    (comp.lang.java.programmer)
  • Re: Sockets
    ... I've ran a few basic scripts now which I accessed through a telnet ... // if client requests session end ... // reverse client input and send back ... argument the server seems to run fine except for 1 thing: ...
    (comp.lang.php)
  • Sockets
    ... I've ran a few basic scripts now which I accessed through a telnet ... // if client requests session end ... // reverse client input and send back ... argument the server seems to run fine except for 1 thing: ...
    (comp.lang.php)