🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
4 messages
4 total messages Started by Zoran Pjevic Fri, 30 Apr 2004 15:18
refreshing tabledata when scrollbars are moved corrupts the display
#1059
Author: Zoran Pjevic
Date: Fri, 30 Apr 2004 15:18
28 lines
1782 bytes
Hi to everybody

I have following problem, and really no clue how to solve it:

A jtable is refreshed by a dataproducer. I have created my own
tablemodel for this. The table is used with a scrollpane and a
viewport.

The data is refreshed every 100 ms. The size of the table can vary
between two refreshs, so I check first if only the data has changed,
or also the number of rows has changed, or even the number of columns
has changed to call either fireTableDataChanged, fireTableRowsUpdated
or fireTableStructureChanged.

The size of the tabel is usually around 50 rows x 1000 columns. This
cannot fit on one screen, so the user can use the scrollbars to move
around.

But if he does so, the display is often flickering, and refreshing is
not fine. 

Is there a way to mutullay exlude the refreshing of the data when the
scrollbars are dragged? 

Any help is welcome.

Have a nice weekend,
Zoran
Re: refreshing tabledata when scrollbars are moved corrupts the display
#1063
Author: John McGrath [TeamB]
Date: Sun, 02 May 2004 06:28
29 lines
2134 bytes
On 4/30/2004 at 11:18:31 AM, Zoran Pjevic wrote:

> Is there a way to mutullay exlude the refreshing of the data 
> when the scrollbars are dragged? 

There is no simple property in JScrollPane you can set that will do this.
I imagine that it would be rather disconcerting for the user to move the
scroll bars and have nothing scroll, which is probably why nobody has
implemented something like this.

If you want to try to implement this, I think this would be the right
approach:  Look at the source code for the JScrollPane class and the
ScrollPaneUI classes to see how they handle events from the scroll bars.
Hopefully, you can override one of the methods and filter out the
adjustment events that return true for getValueIsAdjusting().

Ideally, you will be able to do this in the JScrollPane class itself.  
If you need to mess with the UI delegate, it will be much more difficult.
In that case, you will need to deal with the installation of the delegate,
look-and-feel changes, etc.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Re: refreshing tabledata when scrollbars are moved corrupts the display
#1064
Author: Lori M Olson (TeamB)
Date: Sun, 02 May 2004 15:47
58 lines
3001 bytes
Zoran Pjevic wrote:

> Hi to everybody
> 
> I have following problem, and really no clue how to solve it:
> 
> A jtable is refreshed by a dataproducer. I have created my own
> tablemodel for this. The table is used with a scrollpane and a
> viewport.
> 
> The data is refreshed every 100 ms. The size of the table can vary
> between two refreshs, so I check first if only the data has changed,
> or also the number of rows has changed, or even the number of columns
> has changed to call either fireTableDataChanged, fireTableRowsUpdated
> or fireTableStructureChanged.
> 
> The size of the tabel is usually around 50 rows x 1000 columns. This
> cannot fit on one screen, so the user can use the scrollbars to move
> around.
> 
> But if he does so, the display is often flickering, and refreshing is
> not fine. 
> 
> Is there a way to mutullay exlude the refreshing of the data when the
> scrollbars are dragged? 
> 
> Any help is welcome.
> 
> Have a nice weekend,
> Zoran

There are some issues with flickering and screen refreshes for some 
specific video cards.

If you look in the <jbuilder>/bin/jdk.config file you will find 3 
properties that can be used to minimize this problem.  When people see 
this problem in JBuilder, you just uncomment one or more of those lines 
in jdk.config.  For your own application, you will need to set one or 
more of those values (-Dxxxx) from the "java.exe" command line.

-- 

Regards,

Lori Olson (TeamB)

------------

Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.

Google Advanced Newsgroup Search
     http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
     http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
     http://www.visi.com/~gyles19/fom-serve/cache/1.html
Re: refreshing tabledata when scrollbars are moved corrupts the display
#940
Author: Zoran Pjevic
Date: Mon, 17 May 2004 10:10
10 lines
1366 bytes
On Sun, 02 May 2004 09:47:01 -0600, "Lori M Olson (TeamB)"
<javadragon@techie.com> wrote:

I have solved the problem. Now I monitor the getValueIsAdjusting(),
and when it's true, I stop the Dataproducer thread, so the data inside
the table is not changed, as long as the user draggs the scrollbars. 
Then the user can move the scrollbars just as he wants, the display is
fine.

Thanks for your input.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads