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

unix: Unexpected JSplitPane behaviour after the component resizing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • client-libs



      Name: iaR10016 Date: 09/11/2000



      JDK version:
      java version "1.3.0rc1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-b17)
      Java HotSpot(TM) Client VM (build 1.3.0rc1-b17, mixed mode)

      The following test example demonstrates unexpected JSplitPane component behaviour.
      To reproduce the bug please do the following steps:

         Enter top JTextArea component and type some text.
         Move mouse outside the tested frame and continue to press any keys.
         The keyboard events are processed correctly.
         Then resize the tested frame and repeat these actions.
         When mouse cursor is outside the tested frame bounds,
         keyboard event are not processed now.

         Such effect also observed in the bottom panel - current
         focused componet is changed correctly by "Tab" key pressing only if the frame was
         not resized yet.

      I use KDE graphics environment with "Click to focus" Window focus policy property
      setting. (To set focus policy to "Click to focus" please run KDE Control Center, select
      "Windows Behaviour" node, then select "Properties" node, then select "Click to focus" in
      the "Focuses Policy" list).

      ------------------------- test.java ---------------------------------------------

      import java.awt.*;
      import javax.swing.*;

      public class test extends JFrame {
        public test() {
          super("JSplitPane test");
          JSplitPane splitPane = new JSplitPane( JSplitPane.VERTICAL_SPLIT, new JTextArea(), new ButtonDemo() );
          splitPane.setDividerLocation(200);
          splitPane.setPreferredSize(new Dimension(500, 300));
          getContentPane().add(splitPane, BorderLayout.CENTER);
         }

        public static void main(String[] args) {
          JFrame frame = new test();
          frame.pack();
          frame.setVisible(true);
         }
      }

      class ButtonDemo extends JPanel {
          public ButtonDemo() {
              JButton b1 = new JButton("Button 1");
              add(b1);
              JButton b2 = new JButton("Button 2");
              b2.setNextFocusableComponent(b1);
              add(b2);
          }
      }

      ---------------------------------------------------------------------------------

      Please note that this efect is present only for the JSplitPane component. For example,
      the following code demonstrates correct events processing:

      ------------------------- test1.java --------------------------------------------

      import java.awt.*;
      import javax.swing.*;

      public class test1 extends JFrame {
        public test1() {
          super("JTextArea test");
          getContentPane().add(new JTextArea());
         }
        public static void main(String[] args) {
          JFrame frame = new test1();
          frame.setSize(new Dimension(500, 300));
          frame.setVisible(true);
         }
      }

      ---------------------------------------------------------------------------------

      ======================================================================

            hgajewsksunw Hania Gajewska (Inactive)
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: