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

Text fields are not working properly in scroll pane after scrolling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.0u11, 6u3
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      linux, solaris_2.5.1

      Description

      OPERATING SYSTEM(S):
      LinuxAMD64, SUSE LINUX Enterprise Server 9 (x86_64)

      FULL JDK VERSION(S):
      java version "1.5.0_11"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_11-b03, mixed mode)

      DESCRIPTION:

      We have a graphical user interface with a panel within a scroll pane.
      When we are scrolling down the page, the text fields stop working. Scrolling up again the text fields at the top of the panel still work fine. The unique text fields that are working correctly are the ones that are displayed the first time.


      Steps to reproduce:

      1. Compile and Run the attached test case on the above mentioned java
         version without any option.
      2. Write on the visible text box in that scroll pane.
      3. Scroll down the scroll pane and try to write on the text field which
         is visible after scrolling.
      4. Click on any text field visible after scrolling and write some text.
         It will not visible. Minimize the window and maximize it, and it
         will show the text.

      Testcase source:

      import java.awt.Frame;
      import java.awt.GridLayout;
      import java.awt.Panel;
      import java.awt.ScrollPane;
      import java.awt.TextField;
      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;

      public class TestScrollPane extends Panel {

          public TestScrollPane() {
              setLayout(new BorderLayout());
              GridLayout gl = new GridLayout(40, 40);
              Panel panel = new Panel();
              panel.setLayout(gl);

              gl.setVgap(50);
              int b = 0;
              for (int j = 0; j < 10; j++) {
                  panel.add(new TextField("TextField " + b));
                  gl.setVgap(50);
                  ++b;
              }

              // Add panel to a scroll pane.
              ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
              //ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_NEVER);

              sp.add(panel);

              // Add scroll pane to the content pane.
              add(sp, BorderLayout.CENTER);

          }

          public static void main(String[] args) {
              final Frame frame = new Frame();
              frame.add(new TestScrollPane());

              frame.setSize(600, 400);
              frame.setVisible(true);

              frame.addWindowListener(new WindowAdapter() {

                                          public void windowClosing(WindowEvent arg0) {
                                              frame.dispose();

                                          }
                                      });
          }
      }

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: