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

JScrollPane: row header autoscrolling not reflected in content

XMLWordPrintable

    • Fix Understood
    • generic, x86, sparc
    • generic, solaris, solaris_2.6, windows_nt

      Name: dbT83986 Date: 01/10/99


      When a JScrollPane has a row header view, autoscrolling in the
      row header is not reflected by the viewport view.

      This is demonstrated by the attached code. Compile it and run
      it. The left-hand list is the row header view, and the
      right-hand list is the viewport view. Click in the right-hand
      list and drag down to make the list scroll up. The left-hand
      list scrolls with it, so the numbers are still lined up. Now,
      click in the left-hand list and drag down to make it scroll up.
      The right-hand list does not scroll, so the numbers get out
      of alignment.

      //------------------------------------------
      import javax.swing.*;

      public class ScrollPaneBug
      {
        public static void main(String[] argv)
        {
          DefaultListModel listModel = new DefaultListModel();
          
          for (int i=0;i<200;i++)
          {
            listModel.addElement("" + i);
          }
          
          JList headerList = new JList(listModel);
          headerList.setFixedCellWidth(100);
          JList contentList = new JList(listModel);
          
          JScrollPane scrollPane = new JScrollPane(contentList);
          scrollPane.setRowHeaderView(headerList);
          
          JFrame frame = new JFrame();
          frame.setSize(new java.awt.Dimension(300,300));
          frame.getContentPane().add(scrollPane);
          
          frame.show();
        }
      }
      (Review ID: 52266)
      ======================================================================

      Name: skT88420 Date: 05/25/99


      Note this maybe a repeat of 4202002

      If I create my own header component and add it to a JScrollPane
      it seems that it isn't repainted properly when scrolled. Under
      the windows l&f this appears as a grey bar where the component
      should be. If I resize the (JInternalFrame) frame then it gets
      painted but in the wrong position - the start (x =0) position
      of the component is displayed rather than the scroll bar
      position. If I now scroll left then I finally see the bar as I
      should .
      (Review ID: 83444)
      ======================================================================

            Unassigned Unassigned
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: