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

Word wrap broken for JTextArea

    XMLWordPrintable

Details

    • b70
    • x86
    • linux

    Backports

      Description

        FULL PRODUCT VERSION :
        OpenJDK Runtime Environment (build 1.7.0-internal-fkung_03_aug_2007_10_41-b00)
        OpenJDK Client VM (build 1.7.0-internal-fkung_03_aug_2007_10_41-b00, mixed mode)

        ** b17 build

        ADDITIONAL OS VERSION INFORMATION :
        Linux toddy 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 15:37:31 EDT 2007 i686 i686 i386 GNU/Linux

        A DESCRIPTION OF THE PROBLEM :
        Word wrap does not work in JTextArea: long lines are not wrapped.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Created a JTextArea with a long string; turn on word wrapping.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        text area with wrapped lines
        ACTUAL -
        text area without wrapped lines

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        testcase:

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

        public class WordWrap
            extends JFrame
        {
          public WordWrap()
          {
            super("Word Wrap Testcase");
            setSize(200, 100);
            final Container contentPane = getContentPane();

            JPanel innerPanel = new JPanel();
            innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.LINE_AXIS));

            JTextArea txt = new JTextArea("This is a long line that should wrap, but doesn't...");
            txt.setLineWrap(true);
            txt.setWrapStyleWord(true);
            innerPanel.add(txt);

            contentPane.add(innerPanel, BorderLayout.SOUTH);
          }

          public static void main(String args[])
          {
            WordWrap cp = new WordWrap();
            cp.setVisible(true);
          }
        }

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

        Release Regression From : 7
        The above release value was the last known release where this
        bug was not reproducible. Since then there has been a regression.

        Attachments

          Issue Links

            Activity

              People

                gsm Sergey Groznyh (Inactive)
                igor Igor Nekrestyanov (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: