// make part of a JTable visible in the scroll region. // Must run on Swing thread. final Rectangle r = jTable.getCellRect( rowIndex, colIndex, true ); if ( r != null ) { jTable.scrollRectToVisible( r ); }
Any program that uses JScrollPane has a potential problem if it ever sets the position of the scroll using one of the techniques above. The user may also be trying to scroll at the same time. The program should defer to the user, e.g. if the user has recently moved the scroll, or is holding the thumb bar with mouse right now, defer the scroll move to later, and ignore it entirely if there is another scroll setting. This logic properly belongs in JScrollPane. I wonder if anyone has ever tackled this problem or wants to. There might even be a way to introduce and enhanced JScrollPane into arbitrary programs unaware of the problem, with a L&F.
|
|
available on the web at: |
http://mindprod.com/jgloss/jscrollpane.html |
optional Replicator mirror
|
J:\mindprod\jgloss\jscrollpane.html | |
![]() |
Please email your
feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear
wording, broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Blog | Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[50.16.36.153] |
|
| Feedback | You are visitor number 27,968. | |