cursor problem in swing component...

N

nono_jun

Hi. I have problem related with swing component.

I want to change a cursor which is a default icon in windows xp.
(C:/WINDOWS/Cursors/stopwtch.ani) -> animation icon. Icon move like
clock rinigng.

But Because of the file description ( .ani, and .cur. ) I can't use
that icon in swing component.

Cursor works invisiblely. Java doc says that when cursor is inable ,
Icon become trasparent.

When I use jpg format for below logic, it was working well.

So is there any way to use that file for cursor ?

logic is here.----------------------------------
File file = new File("C:/WINDOWS/Cursors/stopwtch.ani");

if(file.exists()){
Image image = Toolkit.getDefaultToolkit().getImage("C:/WINDOWS/Cursors/
stopwtch.ani");

Point point = new Point(0, 0);
Cursor cursor = this.getToolkit().createCustomCursor(image, point,
"stopwtch");
glassPane.setVisible( true ) ;
glassPane.setCursor(cursor);
--------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top