Mouse Cursor Not Changing

I have the following:

panel =new JPanel(new BorderLayout());

tb = createToolBar();

p2 =new JPanel();

panel.add(tb, BorderLayout.NORTH);

panel.add(p2, BorderLayout.CENTER);

when a button is clicked in the toolbar i try to change the parents panel mouse cursor to the HAND_CURSOR.

//inside the toolbar class when a button is clicked

getParent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

...well the cursor is not changing. I know that when you set the cursor for a Container that all subcomponents will get that cursor if their cursor is null...otherwise it wont. So i recursively printed out the children components of the parent, as well as their comp.getCursor() and they all have the HAND_CURSOR...which is expected since I had just set it.

I also tried, recursively setting the cursor for the parent and all children to null

comp.setCursor(null);

...as i recursively set the cursor to null I printed out the result of comp.getCursor(). Sure enough it was always "java.awt.Cursor[Default Cursor]". So, according to the Component.setCursor documentation the cursor wont change for anything in the Container...since its subcomponents have non-null cursors.

Any ideas why it doesnt show up? or how to do it?

[1473 byte] By [codecraiga] at [2007-10-2 10:14:38]
# 1

ok i took amethod (found in java newsletter):

RootPaneContainer root = (RootPaneContainer) component.getTopLevelAncestor();

root.getGlassPane().setCursor(cursor);

root.getGlassPane().setVisible(true);

this works, b/c it sets the cursor on the glasspane. however, this of course means the cursor is set for the entire JFrame. I only want a certain area to have my new cursor not the entire frame. Any suggestions on perhaps how I could setup the glass pane to know what cursor to set based on where the mouse is?

thanks

codecraiga at 2007-7-13 1:38:23 > top of Java-index,Desktop,Core GUI APIs...
# 2
anyone have any ideas?
codecraiga at 2007-7-13 1:38:23 > top of Java-index,Desktop,Core GUI APIs...