George Dinwiddie
February 12th, 1999, 10:49 AM
Using JDK 1.2, I'm finding that I can successfully set the cursor for a Swing component, but not for a Swing Container. Looking at the Component.setCursor() api, I read
"public void setCursor(Cursor cursor)
Sets the cursor image to the specified cursor. This cursor image is displayed when the contains method for this component returns true for the current cursor location. Setting the cursor of a Container causes that cursor to be displayed within all of the container's subcomponents, except for any subcomponents that are using a non-default cursor."
I'm finding that, for the cursor to be displayed in the container's subcomponents, I have to override setCursor in the container and have it call setCursor in the subcomponent.
Am I missing something?
java.awt.Component.setCursor() documentation
"public void setCursor(Cursor cursor)
Sets the cursor image to the specified cursor. This cursor image is displayed when the contains method for this component returns true for the current cursor location. Setting the cursor of a Container causes that cursor to be displayed within all of the container's subcomponents, except for any subcomponents that are using a non-default cursor."
I'm finding that, for the cursor to be displayed in the container's subcomponents, I have to override setCursor in the container and have it call setCursor in the subcomponent.
Am I missing something?
java.awt.Component.setCursor() documentation