-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.3.0
-
x86
-
windows_2000
Name: ssT124754 Date: 01/12/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
- Start the included example.
- Increase framesize to the right so that there is an area inside
the scrollpane that is not coverd by the table
- drag scrollbar knob around (clicking above or below it does not show error)
The area inside the scrollpane but not coverd by jtable is not
painted correctly. It appears more often, if tablemodel.getValueAt
is slow.
code:
package bugreport;
import javax.swing.JFrame;
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
public class Bug extends JFrame {
JTable scrollTable;
TableModel sourceModel;
JScrollPane scrollPane;
public Bug() {
sourceModel = new MyTableModel();
scrollTable = new JTable(sourceModel);
scrollTable.setPreferredScrollableViewportSize(new Dimension (100,200));
scrollTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
scrollPane = new JScrollPane(scrollTable,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(scrollPane, BorderLayout.CENTER);
}
public static void main(String[] args) {
Bug bug = new Bug();
bug.setSize(400,300);
bug.show();
}
class MyTableModel extends AbstractTableModel {
public int getRowCount() {
return 100;
}
public int getColumnCount() {
return 5;
}
public Object getValueAt(int rowIndex, int columnIndex) {
try {
Thread.currentThread().sleep(1);
} catch (InterruptedException ie) {}
return "A";
}
}
}
(Review ID: 114169)
======================================================================
- duplicates
-
JDK-4320934 Incorrect JViewport background repaint when blit scroll mode is on.
-
- Closed
-