Results 1 to 4 of 4
Thread: Custom Cursor Mouse
- 03-24-2010, 05:33 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
Custom Cursor Mouse
hi
I'm working on a canvas and need to transform
my mouse cursor to a table containing some
attributes when passing on some elements
inside the canvas.
I can catch the "mouse over" and "mouse out"
events, but I can't transform my mouse Cursor.
The final effect I need is something like the little
window that opens when passing the mouse on
advertising links when browsing the internet..
Any ideas on how could I do that with Swing?
thanks
- 03-24-2010, 05:54 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Have a look at the Toolkit.createCustomCursor( ... ) method.
kind regards,
Jos
- 03-24-2010, 07:03 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
Thanks for your answer, JosAH.
The problem with createCustomCursor(..) is that
it doesn't allow to use a java Component (panels,
frames..?) as cursor, but only java.awt.Image
objects.
Is there a way to "cast" a JTable to an Image so
that I can print the content of a bean in a box to
use as a cursor? Or if not a JTable then everything
else that allows to use it as a cursor?
-
Any JComponent can be made into an image by creating a BufferedImage the size of the JComponent, extracting the BufferedImage's Graphic object, and drawing the component with this Graphics object (I think these are the steps as it's been a while since I've done this).
Similar Threads
-
button that runs away from the mouse cursor
By MartinBenes71 in forum New To JavaReplies: 1Last Post: 01-28-2010, 08:00 AM -
Mouse Listener for mouse floating over object?
By Krooger in forum AWT / SwingReplies: 1Last Post: 11-18-2009, 04:34 AM -
change the mouse cursor - crosshair cursor
By cassysumandak in forum New To JavaReplies: 1Last Post: 09-28-2009, 01:57 AM -
Cursor
By serfster in forum New To JavaReplies: 2Last Post: 06-15-2008, 05:49 AM -
Using a cursor
By notnumber6 in forum New To JavaReplies: 3Last Post: 11-26-2007, 10:56 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks