// Make sure most recent material visible, at the bottom. // G O T C H A ! // Use invokeLater to give time for text to render // after a JTextArea.setText before we process the setValue, // otherwise the setValue will be effectively ignored. // Must run on Swing thread. jTextAreaBeingScrolled.setText( newText ); final JScrollBar v = scroller.getVerticalScrollBar(); v.setValue( v.getMaximum() ); /* Use setMinimum for making top visible */Here is how to make a row of JTable visible in the scroll region:
// 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 ); }
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.62] | ![]() | ||
| You are visitor number 15,157. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | ||
| http://mindprod.com/jgloss/jscrollpane.html | J:\mindprod\jgloss\jscrollpane.html | ||