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

JEditorPane within a JScrollPane can throw Swing into an infinite loop

XMLWordPrintable

      J2SE Version (please include all output from java -version flag):
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

      Does this problem occur on J2SE 1.4.x or 5.0.x or 6.0? Yes / No (pick one)
      Yes

      Operating System Configuration Information (be specific):
      Microsoft Windows XP [Version 5.1.2600]

      JEditorPane within a JScrollPane can throw Swing into an infinite loop

      1) Run Code
      2) Enter some text (the word 'test' will do)
      3) Swing now enters into an infinite loop, putting in the scrollbars, then removing them every iteration

      import static javax.swing.JFrame.*;
      import static javax.swing.JSplitPane.*;
      import javax.swing.*;

      public class Test {
        public static void main(String[] args) {
          JFrame frame = new JFrame();
          frame.add(new JSplitPane(HORIZONTAL_SPLIT, new JScrollPane(new JEditorPane("text/rtf", null)), new JLabel()));
          frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
          frame.pack();
          frame.setVisible(true);
        }
      }

            gsm Sergey Groznyh (Inactive)
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: