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

JTable.getScrollableUnitIncrement(...) returns incorrect value

XMLWordPrintable

    • generic, x86, sparc
    • generic, solaris_2.5.1, windows_95



      Name: aaC67449 Date: 02/03/99


      JTable.getScrollableUnitIncrement(visibleRect, SwingConstants.HORIZONTAL, direction)
      always returns 100, but should return width of appropriate column

      javadoc states:
      "
      public int getScrollableUnitIncrement(Rectangle visibleRect,
                                            int orientation,
                                            int direction)

            Returns the scroll increment that completely exposes one new row or column (depending on the orientation).


      "

      See source code (JTable.java:2615):"
          public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
              // PENDING(alan): do something smarter
              if (orientation == SwingConstants.HORIZONTAL) {
                  return 100;
              }
              return rowHeight + rowMargin;
          }
       

      "

      ======================================================================

      Name: krT82822 Date: 06/19/99


      Calling the getUnitIncrement(void) or getBlockIncrement(void)
      on the JscrollPane's internal ScrollBar
      (accessible via getVerticalScrollBar()/getHorizontalScrollBar())
      can yield a different result than calling
      getUnitIncrement(int orientation) on the same scroll bar.
      This is because the inner class ScrollBar does not
      override the getUnitIncrement(void)/getBlockIncrement(void)
      methods to call the overriden
      getUnitIncrement(int)/getBlockIncrement(int) methods
      which can call the ScrollPane's viewport's Scrollable
      interface methods
      getScrollableUnitIncrement()/getScrollableBlockIncrement().
      (Review ID: 53263)
      ======================================================================

            bchristi Brent Christian
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: