Cursor « Development « Java Swing Q&A





1. Small dot trailing cursor in Swing application    stackoverflow.com

There is a small dot that keeps trailing the cursor on a Swing application as I move the cursor about over the application frame. What is causing this?

2. How to hide cursor    stackoverflow.com

Is there anyway to hide cursor other than using transparent gif image?

3. Crosshairs in Java    stackoverflow.com

I am making a game that needs a crosshair. I have been playing with the java.awt.cursor class and that is easy enough, but the problem is that I do not ...

4. How to set custom size for cursor in swing?    stackoverflow.com

I am using the below code to set a custom cursor for JPanel, but when i run the code its enlarging the image which i set for cursor. Is there a way ...

5. Java change cursor    stackoverflow.com

is there any way to change the cursor in Java at all, not just for one JComponent? I need this because I want the cursor to change, when your mouse leaves the ...

6. java wait cursor display problem    stackoverflow.com

I am having issues displaying a wait cursor in my application. Whenever the mouse is above a panel that defines its own cursor, the wait cursor does not appear. If a ...

7. Hand Cursor    coderanch.com

try this: import java.awt.*; import java.applet.*; import java.awt.event.*; public class test2 extends Applet implements MouseMotionListener { Image imageb2; int mousex; int mousey; Cursor c1, c2; public void init() { c1 = new Cursor(Cursor.HAND_CURSOR); c2 = new Cursor(Cursor.DEFAULT_CURSOR); String imgname2="image465x65.gif"; imageb2=getImage(getDocumentBase(),imgname2); this.addMouseMotionListener(this); setLayout(null); setSize(690,270); label1.setText("mouse position"); label1.setAlignment(java.awt.Label.CENTER); add(label1); label1.setFont(new Font("Dialog", Font.BOLD, 16)); label1.setBounds(168,216,418,45); } public void mouseDragged(MouseEvent me) {} public void mouseMoved(MouseEvent ...

8. awt cursor question    coderanch.com

I have a frame window with super class Frame. My frame contains a canvas and when the cursor moves over the canvas, I want it to change to the hand cursor. I did this by calling Cursor canvasCursor = new Cursor(HAND_CURSOR); myCanvas.setCursor(canvasCursor); This works, but when I compile I get the following warning: "NOTE: The variable HAND_CURSOR in class java.awt.Frame has ...

9. custom cursor???    coderanch.com





10. can v use the cursors that are present in the winnt directory?    coderanch.com

i think v can set the cursor of our own choice but the choice is very limited v have a few methods getSystemCustomCursor(); is one of them which suggests that v can get the cursor from the system, can any body suggest how can i use the cursor which is present in the directory "c:\wintnt\cursors" the name of the file is ...

11. Can I have 2 cursors in different components simultaneously??    coderanch.com

I would like to suggest the Excel only has one input focus. You could create two components that know about each other. When one receives focus, the other mirrors the user's input. If you want it to look like a cursor in the component that's mirroring the input, you can do some custom painting. What are your thoughts on that?

12. Using GlassPanel for Cursor Feedback    coderanch.com

13. hwo to use system cursors like the hourglass    coderanch.com

Hi, how can I use the system cursors in my java swing application, plus when I click on a button or menu item it sticks around until the next window is ready to be displayed and it goes away right before the window opens - how do I stop this and use the hourglass or some other system cursor to let ...

14. Set Wait Cursor    coderanch.com

Threre are two Buttons("Save", "Message").If a click "Save" button - it starts to find a particular file from my directory.If file is not there - wait cursor will appear-if file is there wait cursor became default cursor.My main problem is -my wait cursor does not work on window. How can I do it?please give me some solution as early as possible. ...

15. custom cursor in XOR mode    coderanch.com

Hi, I am using a custom crosshair cursor generated with a gif file containing the image. Is it possible that the cursor be shown in XOR mode, as can be seen in many graphics applications. i.e. the cursor (which is white in color) draws itsself in black wherever there is a white area on the panel. Thanks in Advance Amit





17. cursor/copy vertically    coderanch.com

18. Wait Cursor    coderanch.com

I am maintaining some old code in version 1.1.2. In an actionPreformed event handler activated by a button on a Dialog I would like to set the cursor to the WAIT_CURSOR while a login is attempted for a password change. When I add 'setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR))' to my event handler before the login and 'setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR))' at the end of the event handler, the ...

19. creating custom cursor    coderanch.com

It looks like it locks up in the sun.awt.windows.WToolkit class... so the problem is probably in some native code. Short answer : you cannot use animated GIFs as cursors. Long answer : you may be able to fake it by using either - a.) Multiple cursors and switching them with a thread. b.) Using a blank cursor and drawing your image ...

20. Cursor Style    coderanch.com

21. Set the cursor    coderanch.com

Hi. I have a front end application that has JButtons on it. Each of the JButtons is set up to launch another application (each having their own main method). I would like the cursor to be set to WAIT while the app being launched is loading. Then set back to DEFAULT. At what point do I set the cursor back to ...

22. Different Cursors    coderanch.com

That's what I tried before with no luck there must be something else to set or get the cursor. And I still haven't found out what. Would it be helpful if you had the code ? I want the cursor to change when I select a different value from an array thats where I registered the action listener but when I ...

23. Missing Cursor Mistery    coderanch.com

24. wait cursor    coderanch.com

This question was passed to the Swing/AWT forum where it was closed because the question already existed in this forum. Circle with no answers. Not very helpful. The bartender in the forum the message was passed to closed the message because it was a duplicate of the message that was passed to that forum. How about an answer?

25. wait cursor question    coderanch.com

26. Adjusting the size of cursor on HP-UX    coderanch.com

I am running a Java client application on HP-UX(version 11.11). The application displays a file structure. On clicking a particular icon, it displays the contents of that folder. On clicking the icon, a hourglass and a cursor appears (as it does in all Windows applications). However, the size of hourglass and cursor is not proportional to the size of the text ...

27. creating a custom cursor    coderanch.com

28. Cursor not setting    coderanch.com

29. increase the cursor size    coderanch.com

30. Replacement for busy cursor    coderanch.com

31. Why is my custom cursor so large?    coderanch.com

32. how to display an houglass cursor?    coderanch.com

33. magnifier cursor in java    coderanch.com

34. Changing the Cursor    coderanch.com

35. Is it possible to change the cursor with onMouseOver...    coderanch.com

Here is my problem. I have a panel which has some lines drawn over it. I need to change the cursor to hand cursor when I move over the lines. I am able to set the cursor as handcursor for the total panel, but it should be changed when I move the mouse over the lines? Is there an event for ...

36. Zooming in and out - cursor not in the right place    coderanch.com

Hi Guys, I am not sure if this should be in the intermediate forum. However here goes. I zoom a drawing of a line and a circle. However, the cursor does not stay on the fix on the object being dragged. There are two classes. The code is below; package baseDrawing; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import javax.swing.*; public class ...

37. Set Caret Cursor inJTextArea    coderanch.com

Hello everyone, I am very frustrated. I am trying to set my cursor at the beginning of the second line of my JTextArea but the cursor doesn't show when I uncomment the block of code in my JNotePad constructor, why? myFile.txt has just one sentence that says, "This is a test of your local broadcast". Thank you for your assistance. import ...

38. Change cursor    coderanch.com

I am having a button for which i have set the hand symbol cursor by default. On clicking the button I should change the cursor symbol to hour glass until a particular process is made. Currently if I click the button the cursor is not changing it remains the same as the hand symbol but after a while at the end ...

39. setEditable and blinking cursor    coderanch.com

Greetings. I have a JTextPane and I wish to prevent the user from doing any editing. so setEditable(false) was easy enough to find, but the problem is that seems to disable the blinking cursor that represents the caretPosition. I'd like to be able to disable user editing but keep the blinking cursor, is their a way to do this? I suppose ...

41. Set cursor from a .cur file.    coderanch.com

42. Custom Cursor    coderanch.com

Hey, guys! I've been trying to change the cursor for my JFrame and after searching online, I think I've figured out how to do it. The problem is that the cursor appears in black and white. Here's my code: package com.louiskounios; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class UI extends JFrame { JButton startButton; JPanel contentPanel; BackgroundPanel bgPanel; Image cursorImage ...

43. unable to change the cursor to string.    coderanch.com

hello, i wrote a code to change cursor type, my code is: import java.awt.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; interface Cursors { Cursor WAIT_CURSOR = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); Cursor DEFAULT_CURSOR = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); } /** Basic CursorToolkit that still allows mouseclicks */ public class CursorToolkitOne implements Cursors { private CursorToolkitOne() { } /** Sets cursor for specified component to Wait cursor */ public ...

44. how to create custom cursor??    coderanch.com

45. Need help with wait cursor and setEnable( false )    coderanch.com

Hi guys, Please help me with an issue I have. I have a button and when user click it, it does some calculation in another thread and I am doing fine on that part. But I want the cursor to change to hour glass and also setEnable( false ). I don't know why but when I first click the button, the ...

46. A few problems with the Custom Cursor    coderanch.com

Howdy folks, I'm trying to get some good custom cursors up and running but I'm not into a few problems. Firstly, I use createCustomCursor to create my cursors but I notice it doesn't allow you to define the type of cursor (kind of like how Cursor(int) lets you do). This is annoying because I want to create cursors which have to ...

47. Cursor Size    java-forums.org

What is the size of the cursor? I don't see this documented, but I believe, through trial and error, that the size of the cursor is 32 x 32. I've tried creating cursors of different sizes and they seem to be transformed automatically to 32 x 32. (Stretched or shrunk as necessary.) And I don't see any way to change the ...

48. Show Text with cursor    java-forums.org

49. Changing Cursor    java-forums.org

50. Show Cursor    java-forums.org