Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4320934

Incorrect JViewport background repaint when blit scroll mode is on.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.1
    • 1.3.0
    • client-libs
    • ladybird
    • generic, x86
    • windows_nt, windows_2000
    • Verified



        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)
        ======================================================================

              svioletsunw Scott Violet (Inactive)
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: