Java examples for Swing:JTable Scroll
Scroll JTable to Show cell.
import java.awt.Rectangle; import java.util.Collections; import java.util.Comparator; import java.util.Vector; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; import org.apache.log4j.Logger; public class Main{ /**//from w ww . java 2 s . com * Show cell. * * @param table the table * @param row the row * @param column the column */ public static void showCell(JTable table, int row, int column) { Rectangle rect = table.getCellRect(row, column, true); table.scrollRectToVisible(rect); table.clearSelection(); table.setRowSelectionInterval(row, row); } }