JDK-4162268 : Keyboard events get lost in nested JSplitPanes on Solaris
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-07-31
  • Updated: 2001-01-05
  • Resolved: 2001-01-05
Related Reports
Duplicate :  
Description
ralph.kar@Eng 1998-07-30
Run the sample code below on the very latest Swing code on Solaris. There is a JSplitPane with a nested JSplitPane on the right-hand side. Move the focus to one of the components within the nested JSplitPane and hit F8. You are now able to resize the divider with the cursor keys. Hit TAB or CTRL+TAB to get out of the resize mode. Move the focus to the JList on the left-hand side of the outer JSplitPane. Hit F8 again and use the cursor keys to move the divider. Only the first keypress will be executed. All other keypresses do not appear and the focus does not come back (even after hitting TAB). If the Swing window gets overlayed by another window and then brought to the front again the focus comes back.
This does not happen on Win32.
It is also not related to JList (I tried several different components).
It is somehow related to the nesting of JSplitPane, because when I run the example without a nested JSplitPane everything works well.


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

public class TestApp extends JFrame
{
        public TestApp() {
                super("TestApp (4110480)");

                String[] listdata = {"JList 1", "JList 2", "JList 3",
                                     "JList 4", "JList 5", "JList 6"};
                JList list = new JList(listdata);

                JSplitPane split1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                        true,
                        new JScrollPane(new JTextArea("Upper\nJTextArea")),
                        new JScrollPane(new JTextArea("Lower\nJTextArea")));
                JSplitPane split2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                        true, new JScrollPane(list), split1);

                JPanel panel = new JPanel(new GridLayout(1, 2));
                panel.add(new JButton("JButton 1"));
                panel.add(new JButton("JButton 2"));

                this.getContentPane().add("Center", split2);
                this.getContentPane().add("South", panel);

                this.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent ev) {
                                System.exit(0);
                        }
                });
                this.setSize(300, 300);
                this.setVisible(true);
        }

        static public void main(String args[]) {
                new TestApp();
        }
}

Comments
PUBLIC COMMENTS Keyboard events get lost in nested JSplitPanes on Solaris
10-06-2004

EVALUATION Currently (in jdk1.3, kestrel beta), the arrow keys no longer work to resize in this case. Therefore, this bug is not exhibitted. My guess is that, once the arrow keys are made to work again, this bug will reappear, so I am not closing it. hania.gajewska@Eng 1999-09-15 All better in merlin after focus changed and split pane focus fix (4374030). Closing as dup of 4290675, which lets us keep track of the number of focus bugs fixed through our merlin focus efforts. hania.gajewska@Eng 2001-01-04
04-01-2001