File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes unable to change the cursor to string. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "unable to change the cursor to string." Watch "unable to change the cursor to string." New topic
Author

unable to change the cursor to string.

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
hello, i wrote a code to change cursor type, my code is:

here i m whenever i am cliking to the button cursor is being changed to wait cursor and a string is displaying on the console "setting wait cursor on frame".
now i want that this string should display with my cursor whenever i click the button on the frame.
how can i do this???
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

The only way I can think of is to create your own custom cursor, using Toolkit.createCustomCursor. The Image required for that can contain text if you want to.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
Rob Spoor wrote:The only way I can think of is to create your own custom cursor, using Toolkit.createCustomCursor. The Image required for that can contain text if you want to.





could you please tell me how can i create a custom cursor and change my cursor to string??
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

I've already shown you the method you need. Now all you need to do is create an Image. You can use BufferedImage for that, or one of many, many external image manipulation programs.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
Rob Spoor wrote:I've already shown you the method you need. Now all you need to do is create an Image. You can use BufferedImage for that, or one of many, many external image manipulation programs.




Actually the thing is, i don't want any image as my cursor, using image i have done, my code is:



but here i want to replace the image to a string, i mean to say that instead of image i want to show a string/text here, how can i do this???
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

An image can contain text as well. And please UseCodeTags from now on.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
Rob Spoor wrote:An image can contain text as well. And please UseCodeTags from now on.


thank you i will use CodeTags from of now.
let me explain you what i need to do exactly, i m trying to create a desktop application for java tests takers,
here i require to do user drag his/her answer from the choices and put that to the proper place, he/she not require to select, he/she only need to drag and drop, This is about my desktop application. Just like the simulators provided by Whizlabs.

What extra/updation i want in this is:

when user drag the component/their answer, the text which is the answer, i mean to say the answer should also comes as the tooltip/cursor when the user drag and remains upto the user drop.

What i m think to achieve this is:
i wrote a code for drag nd drop is, jst for example not the actual code:



Code is working properly, bt when i drag the radio, it shows a a [color=green]rectangle and plus sign
below the cursor, and i want here the string/text which is the radio button text.[/color]

for this i think to do it using cursor, but still i am not achieving this, now can you please help me in this, this is my actual problem???

Thank You.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
Punit Jain wrote:
Rob Spoor wrote:An image can contain text as well. And please UseCodeTags from now on.


thank you i will use CodeTags from of now.
let me explain you what i need to do exactly, i m trying to create a desktop application for java tests takers,
here i require to do user drag his/her answer from the choices and put that to the proper place, he/she not require to select, he/she only need to drag and drop, This is about my desktop application. Just like the simulators provided by Whizlabs.

What extra/updation i want in this is:

when user drag the component/their answer, the text which is the answer, i mean to say the answer should also comes as the tooltip/cursor when the user drag and remains upto the user drop.

What i m think to achieve this is:
i wrote a code for drag nd drop is, jst for example not the actual code:



Code is working properly, bt when i drag the radio, it shows a a [color=green]rectangle and plus sign
below the cursor, and i want here the string/text which is the radio button text.[/color]

for this i think to do it using cursor, but still i am not achieving this, now can you please help me in this, this is my actual problem???

Thank You.




Please atleast guide me how can i do this, please, i required to know this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to change the cursor to string.