Here you can find the source of AutoScrollTable(final JTable table_packets)
public static void AutoScrollTable(final JTable table_packets)
//package com.java2s; //License from project: Open Source License import javax.swing.JTable; import javax.swing.SwingUtilities; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; public class Main { public static void AutoScrollTable(final JTable table_packets) { TableModelListener l = new TableModelListener() { @Override/*w ww . j a v a2 s. com*/ public void tableChanged(final TableModelEvent e) { if (e.getType() == TableModelEvent.INSERT) { SwingUtilities.invokeLater(new Runnable() { public void run() { int viewRow = table_packets.convertRowIndexToView(e.getFirstRow()); table_packets.scrollRectToVisible(table_packets.getCellRect(viewRow, 0, true)); } }); } } }; table_packets.getModel().addTableModelListener(l); } }