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

Cursor keys in AWT Textarea on JTabbedPane doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.4.2
    • client-libs
    • Fix Understood
    • x86
    • windows_2000

      Name: js151677 Date: 08/16/2004


      FULL PRODUCT VERSION :
      java version "1.4.2_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
      Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]
      Service Pack 4

      A DESCRIPTION OF THE PROBLEM :
      If a awt TextArea is located on a JTabbedPane it is no longer possible to move through the written text in the TextArea. Instead the JTabbedPane changes it's selected Tab.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just put a java.awt.TextArea on a JTabbedPane and write some text.
      Now try to move through the text by using the cursor keys.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would recommend that the cursor moves left / right / up / down in the TextArea if I press the recommended key. (Just like the behaviour of the JTextArea on a JTabbedPane)
      ACTUAL -
      The JTabbedPane changes its TAB if I press the cursor key's.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import javax.swing.*;

      public class MyMainClass
      {
      public MyMainClass()
      {
      super();
      }

      public static void main(String[] args)
      {
      MyMainClass aMain = new MyMainClass();
      aMain.testTextAreaProblem();
      }

      public void testTextAreaProblem()
      {
      JFrame aJF = new JFrame("TextArea Test");
      aJF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      Panel aPL1 = new Panel(new BorderLayout());
      Panel aPL2 = new Panel(new BorderLayout());
      TextArea aTA1 = new TextArea(5, 10);
      JTextArea aTA2 = new JTextArea(5, 10);
      aPL1.add(aTA1, BorderLayout.CENTER);
      aPL2.add(new JScrollPane(aTA2), BorderLayout.CENTER);
      JTabbedPane aJTP = new JTabbedPane();
      aJTP.addTab("AWT", aPL1);
      aJTP.addTab("SWING", aPL2);
      aJF.getContentPane().add(aJTP);
      aJF.pack();
      aJF.show();
      }
      }
      ---------- END SOURCE ----------
      (Incident Review ID: 297189)
      ======================================================================

            denis Denis Fokin (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: