|
-
February 12th, 1999, 11:49 AM
#1
setCursor()
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
-
February 12th, 1999, 11:56 PM
#2
Re: setCursor()
There are various problems with setCursor() but the problem you are seeing is
probably the documented behaviour. Most Swing containers are entirely covered
by child components. Since the child component covers the container completely,
any call to setCurson() on the container does not have any effect.
If you are trying to change the curson of a JFrame, there's an article on this
site that covers that. See under 'Swing' category.
-
February 15th, 1999, 08:59 AM
#3
Re: setCursor()
Well, as I read the documentation, it seems to say that calling setCursor()
on a container will pass it along to all components. That seems more
efficient to me than having to call it directly on all components in the
container.
I'm not sure I see the message you mention. Are you talking about
http://www.codeguru.com/java/bbs/55.shtml ?
Is this the message?
-
June 25th, 1999, 04:50 PM
#4
Re: setCursor()
I believe the article you want is:
http://www.codeguru.com/java/articles/188.shtml
(You see, I'm trying to find an answer to the same question.) 
Good luck, and happy coding!
=================================================
Valerie L. Bradley
Software Engineer
Intel Corporation
* All opinions expressed are mine and not those of my employer.
-
March 28th, 2001, 02:45 AM
#5
Re: setCursor()
Thanks for the information .I just needed it .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|