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

REGRESSION: Page down functionality for JTextArea in JScrollpane

XMLWordPrintable

    • 5.0
    • b80
    • x86, sparc
    • solaris_10, windows_xp

      FULL PRODUCT VERSION :
      On Windows:
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

      On Linux:

      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      Linux gaz 2.4.18 #18 SMP Mon Feb 24 11:42:05 EST 2003 i686 unknown

      A DESCRIPTION OF THE PROBLEM :
      If page down is hit more times than it takes to get to the bottom of the text area, the text area will scroll back up slightly leaving the window not quite at the bottom.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      compile and run the code provided.
      hit page down 3-4 times.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the scrollbar to be at the bottom of the window
      ACTUAL -
      after getting to the bottom of the window, hitting page down again scrolls the window back up 1/2 to 1 whole line of text.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /* Copyright 2004 The MathWorks, Inc.
       * $Revision: $
       */

      /**
       * Created by: kthomas
       * Date: Nov 11, 2004
       */
      import javax.swing.*;
      import java.awt.Font;

      public class TestTextArea {

          public TestTextArea()
          {
              JFrame frame = new JFrame("Text Area");
              JTextArea textArea = new JTextArea();
              textArea.setLineWrap(false);
              
              String s = new String("This is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.\nThis is text to display.");
              textArea.setText(s);
              
              JScrollPane sp = new JScrollPane(textArea);
              frame.getContentPane().add(sp);
              frame.getAccessibleContext().setAccessibleName("the frame");
              frame.setSize(250,300);
              frame.setLocation(300,300);
              frame.setVisible(true);

          }

          public static void main(String[] args)
          {
              new TestTextArea();
          }


      }

      ---------- END SOURCE ----------

      Release Regression From : 5.0
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.
      ###@###.### 2005-03-23 06:55:07 GMT

            peterz Peter Zhelezniakov
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: