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

JTextArea constructor doesn't add scrollbars

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.1.5
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.1.5
    • CPU:
      sparc
    • OS:
      solaris_2.5.1, solaris_2.6

      Description

      The constructor for JTextArea: public JTextArea(String text, int rows, int columns, int scrollbars) is not creating any scrollbars. A previous bug #4079951 was logged that said the vertical int was causing a horizontal scrollbar. Now no scrollbar choices work.

      This occurs with swing-0.5.1 and the JDK1.2Q.

      These 3 variables do not work in the following example: SCROLLBARS_BOTH, SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_VERTICAL_ONLY

      import com.sun.java.swing.*;
      import java.awt.*;

      public class test4 extends JFrame {

          public test4() {
              setLayout(new BorderLayout());
              String SomeStr = "hello";
              JTextArea myTextArea = new JTextArea(SomeStr, 10, 10, JTextArea.SCROLLBARS_HORIZONTAL_ONLY);
              add("Center", myTextArea);
              System.out.println(myTextArea.getScrollbarVisibility());
          }

          public static void main(String args[]) {
              test4 myWindow = new test4();
              myWindow.setTitle("My JTextArea Example");
              myWindow.pack();
              myWindow.show();
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tprinzinsunw Timothy Prinzing (Inactive)
              Reporter:
              nschorrsunw Nancy Schorr (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: