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

Incompatible change in JTable.getScrollableBlockIncrement()

XMLWordPrintable

    • kestrel
    • kestrel
    • sparc
    • solaris_2.6



        Name: asC58863 Date: 02/23/99


        Implementation of the JTable.getScrollableBlockIncrement() has been incompatibly
        changed in JDK-1.2.2-H.

        (See JavaDoc comments)
        public int getScrollableBlockIncrement(Rectangle visibleRect,
                                               int orientation,
                                               int direction)

          Returns The visibleRect.height or visibleRect.width, depending on the table's
          orientation.

        This method has complied with the specification until JDK-1.2.2-H. Starting with
        JDK-1.2.2-H it does not return visibleRect.height when orientation is
        SwingConstants.VERTICAL.

        Here is the test example:

        ------------------ Test.java -----------------
        import java.awt.*;
        import javax.swing.*;

        class Test {

            public static void main(String[] argv) {

               JTable c = new JTable();
               Rectangle r = new Rectangle(10,30);
               System.out.println(" VERTICAL ScrollableBlockIncrement "+
                        c.getScrollableBlockIncrement(r,SwingConstants.VERTICAL,0));
               System.out.println(" Should be "+r.height);

               System.exit(0);
            }
        }
        -------------- Output from the test -----------------
        (ans@matmech(pts/7): ~/work .343)
        :\>java -fullversion
        java full version "JDK-1.2.2-G"
        (ans@matmech(pts/7): ~/work .343)
        :\>java Test
         VERTICAL ScrollableBlockIncrement 30
         Should be 30
        (ans@matmech(pts/7): ~/work .343)
        :\>java -fullversion
        java full version "JDK-1.2.2-H"
        (ans@matmech(pts/7): ~/work .343)
        :\>java Test
         VERTICAL ScrollableBlockIncrement 17
         Should be 30

        ------------------------------------------------------

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

              sharonz Sharon Zakhour (Inactive)
              anssunw Ans Ans (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: