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

Kestrel-V, TAB functionality is broken in JTextArea

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: client-libs

      Description



      Name: jbT81659 Date: 03/12/2000

      Compile and run the following code.
      Go to Home position in JTA1 and press TAB several times.
      Note that cursor moves one tab to the right then stops.
      Select the whole line using SHIFT+Home or SHIFT+End depending on the cursor location.
      Note that tabs have been inserted but cursor does not move with them as expected.
      Deleter RTL text and insert an english word or phrase.
      Go to Home position in JTA1 and press TAB several times.
      Note that cursor stays at begining of word as you insert tabs.

      ----Code--------

      /* Copyright (c) Sun Microsystems 1999

      $Header: /home/sun/src/JDK1.2/jTextArea.java,v 1.9 1999/12/15 13:46:39 isam Exp $

      */

      import java.awt.*;
      import java.awt.event.*;
      import java.awt.font.*;
      import javax.swing.*;
      import javax.swing.border.*;
      import javax.swing.text.*;

      public class jTextArea extends JApplet
      {
        public void init()
        {
          jTextComponent1 jTextComponent2 = new jTextComponent1();
          getContentPane().add(jTextComponent2);
        }

        public static void main(String[] args)
        {
          JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
          frame.setContentPane(new jTextComponent1());
          frame.pack();
          frame.setVisible(true);
              frame.addWindowListener( new WindowAdapter()
              {
                   public void windowClosing( WindowEvent e)
                   {
                       System.exit(0);
                   }
              });

        }
      }
      class jTextComponent1 extends JPanel
      {
        public jTextComponent1()
        {
          JLabel l;
          JPanel p;
          JTextArea area;
          JTextPane pane;
          JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));

          p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
          l = new JLabel("JTA1");
          l.setVerticalAlignment(SwingConstants.BOTTOM);
          area = new JTextArea(10,45);
          area.setFont(new Font("Lucida Sans Regular", Font.PLAIN, 9));
          area.setText("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd");
          area.setLineWrap(true);
          p.add(l);
          p.add(area);
          p.setPreferredSize(new Dimension(375,310));
          panel.add(p);

          panel.setPreferredSize(new Dimension(400,400));
          JScrollPane scroll = new JScrollPane(panel);
          scroll.setPreferredSize(new Dimension(420,450));

          add(scroll);
        }
      }


      WorkAround:
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            bcbeck Brian Beck (Inactive)
            Reporter:
            jbenavrasunw Jonathan Benavraham (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: