You could try calling "setAutoscrolls(false)" on your table.
Although the javadoc talks about handing mouse drag events, it should also disable scrolling on row/cell sections also.
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class TableTest extends JFrame {
private JTable table;
/**
* Create a new TableTest Frame.
* @param title The title of the frame.
*/
public TableTest() {
Object[][] tableData = new Object[][] {
{1, "One"}, {2, "Two"}, {3, "Three"},
{4, "Four"}, {5, "Five"}, {6, "Six"}};
DefaultTableModel tableModel = new DefaultTableModel(tableData, new String[] {"A", "B"});
table = new JTable(tableModel);
table.setAutoscrolls(false);
JScrollPane scrolly = new JScrollPane(table);
setLayout(new BorderLayout());
add(scrolly, BorderLayout.CENTER);
}
/**
* @param args
*/
public static void main(String[] args) {
TableTest frame = new TableTest();
frame.pack();
frame.setSize(200, 100);
frame.setVisible(true);
}
}