Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1076

Re: Problem with swing

From "Dan Andrews" <dan.andrews@THRWHITE.remove-dii-this>
Subject Re: Problem with swing
Message-ID <1172758505.175194.253620@z35g2000cwz.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <es67h7$pes172@cesio.mundo-r.com>
Date 2011-04-27 15:31 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On Mar 1, 3:48 am, ismael <ismael.perna...@gmail.es> wrote:
[snip]
> show it before make the call to the server method. The problem is that the
> GUI shows a jFrame blank, without the label. When the server method call
> finished the jFrame paint the label but it is when all process finished.
[snip]

Ian Wilson has identified your problem and a solution, however,
implementing your own threading model might be more work than you may
want to do. The javax.swing.SwingWorker, which was introduced in the
Java SE 6 release would be worth looking at.

Alternately, if you want to provide your end users with more
interaction than a "please wait" label then you could have a look at
this worker infrastructure ( http://www.ansir.ca/worker.jsp ).
Additionally, James Gosling and Lynn Monsanto wrote
javax.swing.ProgressMonitor and
javax.swing.ProgressMonitorInputStream, so if it is a stream that your
are reading from the server then you could try that too.

Regards,
Dan Andrews

-------------------
http://www.ansir.ca
-------------------

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar


Thread

Problem with swing "ismael" <ismael@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
  Re: Problem with swing "Dan Andrews" <dan.andrews@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000

csiph-web