Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Ian Wilson" Subject: Re: JScrollPane - ScrollB Message-ID: X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <1164367301.679322.327360@m7g2000cwm.googlegroups.com> References: <1164367301.679322.327360@m7g2000cwm.googlegroups.com> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 45 Date: Wed, 27 Apr 2011 15:26:01 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303917961 96.60.20.240 (Wed, 27 Apr 2011 10:26:01 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:26:01 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:173 To: comp.lang.java.gui Bart Cremers wrote: > Bill wrote: > >>Hi All, >> >> I have a JScrollPane containing a JTable. >> >> I programatically traverse the JTable by selecting rows and scrolling >>the JTable >> >> jTable.scrollRectToVisible(r); >> >> >> However the scrollbar doesn't get updated until after all my processing >>has completed, then the scrollbar 'jumps' to the bottom. Is there any way to >>get it to be updated while the jTable is being processed, so the user has >>some indication of how far the processing has progressed? >> >>TIA >> >>Bill > > > The issue here probably is the fact that Java doesn't get the time to > repaint the scrollpane/table. > > To solve this allow remove control from your traverse thread (hopefully > this is a different thread then the event thread) for a short period by > using Thread.yield() or thread.sleep(50). > I wonder if thread priorities might also be an issue? On my non-GUI worker threads I use t.setPriority(Thread.NORM_PRIORITY); before invoking t.start();. Just a thought. --- * 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