-
Bug
-
Resolution: Fixed
-
P3
-
1.2.2
-
kestrel
-
generic
-
generic
Name: vi73552 Date: 06/21/99
When adding a Canvas as a child of a JSplitPane, JSplitPane does
not handle the mouse pointer correctly.
With JPanel as a child, if we move the pointer
over the divider, the pointer changes into a two arrows pointer
to indicate the posibility of moving the divider. When we move
the pointer away from the divider, it recovers its original shape.
This does not happen if we move the mouse into the Canvas with
enough speed. Here is an example of code, with a JSplitPane, left
component JPanel and right component Canvas:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SplitPaneDemo extends JFrame
{
public SplitPaneDemo()
{
JSplitPane split = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, new JPanel( ), new Canvas( ) );
split.setDividerLocation( 128 );
getContentPane( ).add( split );
}
public static void main( String[] args )
{
SplitPaneDemo demo = new SplitPaneDemo( );
demo.setSize( new Dimension( 256, 256 ) );
demo.addWindowListener( new WindowAdapter( )
{
public void windowClosing( WindowEvent e )
{ System.exit( 0 ); }
});
demo.setVisible( true );
}
}
Using a JPanel instead of a Canvas is not a valid workaround for
me, because I want to place several instances of Canvas3D inside
a layout composed by nested JSplitPanes, and Canvas3D extends
Canvas.
My version of JDK is:
java version "1.2.1"
Classic VM (build JDK-1.2.1-A, native threads)
JAVA.EXE full version "JDK-1.2.1-A"
(Review ID: 84517)
======================================================================