As usual with these kind of errors, I could not reproduce it (which does not mean, that the bug does not exist). I’ve tried an application like the one below. When I change the cursor it stays changed (unless I move the mouse off the tree). Even if I do all kind of drag and drop stuff, the mouse still remains changed over the tree.
What is the difference between your application and my test app?
[Edit: I did use the newest version for this, 1.1.1p5c]
import java.awt.Container;
import java.awt.Cursor;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.CGrid;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
public class CursorTest {
public static void main( String[] args ){
JFrame frame = new JFrame();
CControl control = new CControl(frame);
frame.add( control.getContentArea());
CGrid grid = new CGrid( control );
grid.add( 0, 0, 1, 1, createDockable( "A" ) );
grid.add( 1, 0, 1, 1, createDockable( "B" ));
control.getContentArea().deploy( grid );
frame.setBounds( 20, 20, 400, 400 );
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.setVisible( true );
}
private static DefaultSingleCDockable createDockable(String title){
final JTree tree = new JTree();
JButton button = new JButton("Cursor");
button.addActionListener( new ActionListener(){
@Override
public void actionPerformed( ActionEvent e ){
tree.setCursor( Cursor.getPredefinedCursor( Cursor.HAND_CURSOR ) );
}
});
DefaultSingleCDockable dockable = new DefaultSingleCDockable( title, title );
dockable.setLayout( new GridBagLayout() );
dockable.add( button, new GridBagConstraints( 0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets( 0, 0, 0, 0 ), 0, 0 ) );
dockable.add( new JScrollPane( tree ), new GridBagConstraints( 0, 1, 1, 1, 1.0, 10.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 0, 0, 0, 0 ), 0, 0 ) );
return dockable;
}
}