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

----- Original Message -----
From: <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 9:48 AM


> bonjour a tous, j'aurais une petite question a vous poser:
>
> j'ai une jTable, et je voudrais que lorsque je lui ajoute une ligne,
mettre
> le focus sur la cellule de cette ligne mais je n'y arrive pas!!
> pire, je ne sais meme voir ma nouvelle ligne directement, car la scrollbar
> verticale , (meme si je lui dis de se positionner tt en bas) ne descend
pas
> jusque tt en bas.  je suis alors oblige de descendre moi meme l'ascenseur
> et de mettre mon focus ds la cellule.
>
> est ce que quelqu'un aurait une idee??
>
>
> merci
>
> jerome

Répondre à