Fais tu un fireTableRowsInserted( i, i ) apres l'insertion sur ton
TableModel,
un addRowSelectionInterval( i, i ) sur ta table?



----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 10:57 AM


>
>
> ***j'ai essaye ta methode mais ca marche tjrs pas!!! :(
>
>
> Salut,
> Pour scroller au row specifi�:
> /**
>     * Scroll to the specified row in the table.
>     * @param The row in table that is to be in scroll viewport.
>     */
>    public void scrollTo( int anIndexIntable ){
>
>       Rectangle theCellRectangle = theTable.getCellRect(anIndexIntable, 0,
> true);
>       Rectangle theViewRectangle =
> theScrollPane.getViewport().getViewRect();
>
>       if ( theCellRectangle.y + theCellRectangle.height >
> theViewRectangle.y
> + theViewRectangle.height ||
>            theCellRectangle.y < theViewRectangle.y ){
>
>          int theTableHeight = theFrameContainer.theTable.getHeight();
>          // it scrolls to table down limit
>          if ( theCellRectangle.y > theTableHeight -
> theViewRectangle.height ){
>
> theFrameContainer.theScrollPane.getViewport().scrollRectToVisible( new
> Rectangle( theViewRectangle.x, theTableHeight + theCellRectangle.height -
> theViewRectangle.height, theViewRectangle.width,
> theViewRectangle.height ) );
>          }
>          // it does not scroll to table down limit
>
>
>
> heFrameContainer.theScrollPane.getViewport().setViewPosition( new
> oint( theViewRectangle.x, theCellRectangle.y ) );
>          }
>
>       ( ( AbstractTableModel ) theTable.getModel() ).fireTableDataChanged
> ();
>       }
>
>    }
>
> Beno�t

Répondre à