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

Paste of long line into JTextArea with wrap set does not repaint

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.7, 1.2.0
    • client-libs



      Name: tb29552 Date: 11/04/98


      /*

      Swing 1.1 beta3, jdk1.1.7, Windows NT 4.0, Metal
      Look and Feel & Windows Look and Feel (haven't
      tried Motif)

      Run the following program, and paste a long line
      of text (with no new lines) into the JTextArea.
      The wrap is computed, but the JTextArea does not
      repaint until further user intervention happens.

      */
      // Start PasteWrapBug.java
      import javax.swing.*;

      public class PasteWrapBug {
          public static void main(String[] args)
          {
              PasteWrapBug bug = new PasteWrapBug ();
          }

          public PasteWrapBug ()
          {
              JFrame frame = new JFrame("Paste wrap bug");
              JTextArea area = new JTextArea("Paste a long selection with no new lines in here");
              area.setLineWrap(true);
              area.setWrapStyleWord(true);
              JScrollPane pane = new JScrollPane(area,
                                         JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                          JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
              frame.getContentPane().add(pane);
              frame.setSize(300, 200);
              frame.setVisible(true);
          }
      }
      // End PasteWrapBug.java

      (Review ID: 42090)
      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: