Sunday, December 12, 2010

Jtable inconsistent / wrong data / values when scrolling

Sometimes your jtable shows inconsistent values when you use a scrollbar to scroll . Youcan avoid that by adding the lines below

JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
scrollBar.addAdjustmentListener(new AdjustmentListener() {
public void adjustmentValueChanged(AdjustmentEvent e) {
scrollPane.repaint();
}
});

No comments: