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

JTextArea.setComponentOrientation does not work with correct timing

    XMLWordPrintable

Details

    • b12
    • generic, x86
    • generic, windows_98, windows_2000

    Description

      Name: dk106046 Date: 07/03/2002

      Problem found on Windows 2000, RedHat7.2, TurboLinux7.0

      java version "1.4.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
      Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

      -Run the test case: java JTextAreaTest
      -The JTextArea does not appear to have "RIGHT_TO_LEFT" orientation.
       The text "jtext" is aligned to the left not to the right.
      -Type some text into the text area.
      -Now the text is aligned to the right as was originally expected.

        -----------------------------------------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      public class JTextAreaTest extends JTextArea {
              public JTextAreaTest() {
                      super();
                      setText("Swing JTextArea component");
                      setName("jtext");
                      addKeyListener(new MyKeyListener());
                      setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
              }
              public static void main(String[] args) {
                      JFrame frame = new JFrame("Swing JTextArea component");
                      frame.getContentPane().add(new JTextAreaTest());
                      frame.addWindowListener(new WindowAdapter() {
                              public void windowClosing(WindowEvent event) {
                                      System.exit(0);
                              }
                      });
                      frame.setSize(300, 300);
                      frame.show();
              }
      }
      -----------------------------------------

      Also the key binding control+shift+o key for toggling between "RIGHT_TO_LEFT" and "LEFT_TO_RIGHT" orientations only works after some text has been typed into the text area.

      ======================================================================
      ###@###.### 10/13/04 18:47 GMT

      Attachments

        Issue Links

          Activity

            People

              psadhukhan Prasanta Sadhukhan
              dkorbel David Korbel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: