-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
beta
-
generic
-
generic
Name: ks88420 Date: 08/30/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
When changing the location of a JSplitPane divider by dragging
it with the mouse, a focused component inside the split pane
keeps the keyboard focus -- this is a good thing.
However, when changing the location of the divider by clicking on
one of its "one touch" buttons, the focused component inside the
split pane will LOSE the focus -- this is a bad thing (bug).
I'm not sure why this happens (since 4202792 seems to be fixed).
---
In the attached test case, there's a one touch expandable JSplitPane
containing a JTextArea (left) and a JTree (right). After starting
the program, the JTextArea has the keyboard focus.
Try expanding the JTextArea to the full width by clicking
on the right arrow button on the divider. The JTextArea
will lose the focus and the user now has to manually restore
it before he can continue typing anything into the text area.
---
import java.awt.*;
import javax.swing.*;
public class MyTest extends JFrame {
public MyTest() {
super("MyTest");
JSplitPane spltPn = new JSplitPane();
spltPn.setOneTouchExpandable(true);
spltPn.setLeftComponent(new JTextArea());
spltPn.setRightComponent(new JTree());
spltPn.setDividerLocation(290);
setContentPane(spltPn);
setSize(new Dimension(608, 384));
setLocation((getToolkit().getScreenSize().width - getWidth()) / 2,
((getToolkit().getScreenSize().height) - getHeight()) / 2);
show();
}
public static void main(String[] args) {
new MyTest();
}
}
(Review ID: 108794)
======================================================================