-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
ladybird
-
generic, x86
-
windows_nt, windows_2000
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2032631 | 1.4.0 | Scott Violet | P3 | Resolved | Fixed | beta |
Name: krT82822 Date: 03/12/2000
12 Mar 2000, eval1127@eng -- this seems as though it may be a new, though related problem. Thus, filing a separate bug.
(see also 4295814, 4310721)
java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-T)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S, mixed mode)
1) Compile & execute the program below.
3) Check that there is an empty space on the right of the center table (if not,
please resize the frame to have one)
2) Scroll down to the bottom of the table by quickly dragging the vertical
scrollbar knob.
You should see that the empty space located at the right of the center table was
filled with some parts of the row header.
Please note that this bug can be related to #4310721 but, in our case, the
center component cannot be easily stretched.
// Code begins
import java.awt.Dimension;
import java.text.MessageFormat;
import javax.swing.JTable;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JViewport;
import javax.swing.table.AbstractTableModel;
public class ScrollPaneBug
{
public static void main(String[] args) {
JTable centerTable = new JTable(new FakeTableModel("Center ({1}, {0})",
1));
centerTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
JScrollPane sp = new JScrollPane(centerTable);
sp.setRowHeaderView(new JTable(new FakeTableModel("Header ({1}, {0})",
2)));
// Workaround : uncomment the following line
// sp.getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(sp);
f.setSize(new Dimension(800, 600));
f.show();
}
}
class FakeTableModel extends AbstractTableModel
{
private MessageFormat _format;
private int _columnCount;
FakeTableModel(String formatPattern, int columnCount) {
_format = new MessageFormat(formatPattern);
_columnCount = columnCount;
}
public int getColumnCount() {
return _columnCount;
};
public int getRowCount() {
return 1000;
};
public Object getValueAt(int row, int col) {
return _format.format(new Object[] { new Integer(row), new Integer(col)
});
}
}
// code ends
(Review ID: 101526)
======================================================================
- backported by
-
JDK-2032631 Incorrect JViewport background repaint when blit scroll mode is on.
-
- Resolved
-
- duplicates
-
JDK-4344399 Repaint problems with JScrollPane
-
- Closed
-
-
JDK-4345955 Scrollpane with JTable repaints incorrectly
-
- Closed
-
-
JDK-4404536 Area inside ScrollPane and not used by JTable not drawing correctly
-
- Closed
-
-
JDK-4336787 Scrolling a JTable draws spurious objects to the right of the table
-
- Closed
-