How to hide mouse cursor ?

How can I hide the mouse cursor, when I am over a component ?

I don't know if there is a better way but ...
create a gif (using PaintShop Pro or something) which has nothing in it or if that can't be done as few pixels as possible. I created mine in c:\tmp\blank.gif for the program below
import java.awt.*;
import javax.swing.*;
import java.net.*;
public class ViewCursor
extends JFrame
public ViewCursor()
throws Exception
Cursor myCursor = null;
try
ImageIcon ii = new ImageIcon(new URL("file:C:/tmp/blank.gif"));
Image im = ii.getImage();
Toolkit tk = getToolkit();
myCursor = tk.createCustomCursor(im, new Point(0,0), "MyCursor");
catch (Exception e)
System.out.println("myCursor creation failed " + e);
getContentPane().setLayout(new FlowLayout());
JPanel p1 = new JPanel();
JPanel p2 = new JPanel();
JButton b1 = new JButton("one");
JButton b2 = new JButton("two");
p1.add(b1);
p2.add(b2);
p1.setCursor(myCursor); // set panel 1 to have the customised cursor
getContentPane().add(p1);
getContentPane().add(p2);
public static void main(String[] args)
throws Exception
ViewCursor v = new ViewCursor();
v.setSize(200, 200);
v.setVisible(true);
when you run this, the cursor disappears when its over p1 / b1

Similar Messages

  • Hide mouse cursor when typing is not working in IE11 Windows7

    Hide mouse cursor when typing is not working in IE11 Windows7 - I saw a post that devs were looking at this in 2011? Slow progress huh?
    This is really annoying when you have to move the cursor to see what you are typing...

    Hi,
    Please first make sure that Mouse Properties\Pointer options\Hide pointer while typing is ticked.
    If this option is already ticked, then try following steps to troubleshoot:
    Update the driver for the mouse to get the best performance.
    Choose a different cursor as Rob said for a test.
    If this issue occurred recently, check if you have any newly installed programs or IE add-ons which cause this issue, you can test this in no add-ons mode, click start button, type "internet" in the search box, choose "internet explorer (No add-on)".
    * I test in My IE, I have Hide pointer while typing checked, and in some typing boxes in IE the cursor will hide automatically, while some are not, but I think it's not an annoying issue for me.*
    Regard
    Yolanda
    TechNet Community Support

  • How to hide mouse?

    Hi guys,
    I would like to hide mouse cursor in my application. My typical requirement is to hide mouse cursor when it is on a button. Can anyone provide me a technique for doing this?
    Thanking you.

    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%22hide+cursor%22&col=javaforums&x=24&y=9

  • How to replace mouse cursor.

    How would you replace the mouse cursor in ActionScript 3?  I mean with like a movie clip or a graphic within Flash.  Thanks.  Code prefered.

    You would need to use a movieclip so that you can assign an instance name to it... here I use cursorMC as the instance name:
    Mouse.hide();
    function followMouse(evt:MouseEvent): void{
         cursorMC.x = mouseX;
         cursorMC.y = mouseY;
    stage.addEventListener(MouseEvent.MOUSE_MOVE, followMouse);

  • How to move mouse cursor

    Hello
    does anybody know how to move the mosecursor with lab view code. If anybody
    have some vi's that take care of this I would be most grateful
    Regards
    Stian Langeland

    For the Win32 case, there's an example available that does this very thing:
    http://digital.ni.com/explprog.nsf/websearch/c33e65e20b23f3e4862565ec004d67ec
    I searched the National Instruments Example Programs Database
    (http://www.ni.com/support/epd/) for "mouse" in order to turn this up.
    Regards,
    John Lum
    National Instruments
    > > Hello
    > > does anybody know how to move the mosecursor with lab view code. If anybody
    > > have some vi's that take care of this I would be most grateful
    > >
    > > Regards
    > > Stian Langeland
    >
    > I think there is no "native" labview solution to your problem.
    > It depends on the platform you are working on. If you use Win32 i'd suggest (if
    > you really need to move the mouse cursor programmatically... do you?) to call
    > some Win32 api func
    tion like MOUSE_EVENT or SEND_INPUT on WinNT. Look them up
    > in M$ documentation. To call them use from the Functions Palette -> Advanced
    > -> Call Library Function.
    > Hope this helps.
    > --
    > Wolf-Dieter Wall

  • XCelsius Map component - how to hide mouse over region value?

    Hi guys,
    I have one problem with a map component:
    Please open standard Xcelsius map sample: File -> Samples -> Map
    If you turn your mouse to state, for example Alabama you will see "Alabama 31.66"
    I need only "Alabama", how to hide this "31.66"?
    I created colored map but user should not see the value, he should see just name of the map region
    Any ideas?
    Thanks in advance

    Question answered
    Option is on the Apperance - Text tab

  • How to identify mouse cursor image?

    I am doing some testing in java- everything else so far is working, but I can't find out how to.. find which image the mouse pointer is. I need to be able to tell when a mouse cursor goes over a link and displays the right cursor. It switches between the default arrow, the little hand for links, and a custom cursor, but I don't know how to retrieve that information.
    Any ideas?
    At first I was going to just use screenshots- but cannot capture mouse cursor/icon that way, and this way would work better.
    Thanks!

    That would make sense, but I haven't found any functions on "get the cursor for the component", or of anything related to getting the cursor.
    I was going to use the robot to move to two specified points on the screen, but then I still have the issue of somehow retrieving any information about the cursor(aside from position/clicks). Would you know offhand which package/function(method) would have it? That one only showed stuff related to movement/events, no cursor information besides position/clicks.
    Thanks!
    Edited by: doomtoo on Sep 3, 2008 11:59 PM

  • How To Change Mouse Cursor Icon To Hand And Click Middle Of Player To Pause In Strobe Media Playback

    Hello,
    Thank you for providing a platform where uses can pose questions to Adobe employees. This certainly helps us all cut right through it.
    Similar to YouTube's player (as well as many others), I was wondering if it is currently possible for users to enable functionality on Strobe Media Playback to change the mouse cursor to a hand/point cursor upon hovering over Strobe Media Playback's buttons (such as pause, the volume controls and that initial large centered middle play button),
    And, whether or not it is currently possible to enable functionality to pause/play videos merely by clicking the middle of the video screen (within the normal view mode as well as the full screen mode). Again, with YouTube, Vimeo, JW Player, and many others, such functionality is currently built-in by default.
    I look forward to any advice you are able to provide. Thanks again for providing this discussion platform for users.
    - C.R.

    Hi, thank you for your suggestions and for the interest in our player.
    The full area click issue is an older one, tracked at http://bugs.adobe.com/jira/browse/ST-156 . Unfortunately, it will not be fixed in this release.
    The hand cursor issue is now tracked at http://bugs.adobe.com/jira/browse/ST-331 - thanks for suggesting it!

  • How to bring mouse cursor to the default button of a dialog, like in windows

    Anybody know how to achieve this in LV?
    Please see the attached screenshot.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Automatically move mouse pointer to the default button.PNG ‏34 KB

    Dear partha,
    1) You can be able to trace out the location of the button
    2) You can be able to move the cursor to that location
    3) You can be able to automatically generate a click on that button
    Use user32.dll to achieve all this. when u use it in CLN(Call Library Node), u can c functions 4 that.
    Try and ask if further help needed!!!!!
    Thanks,
    Mathan

  • How to change mouse cursor during drag and drop

    Hi Guys,
    Iam performing a Drag and drop from Table1(on top of the figure) to Table2(down in the figure).
    see attached figure
    http://www.upload-images.net/imagen/e80060d9d3.jpg
    Have implemented the Drag and drop functionality using "Transferable" and "TransferHandler"using the java tutorial
    http://java.sun.com/docs/books/tutorial/uiswing/examples/dnd/index.html#ExtendedDndDemo
    Now My problem is that ,I want to make the 1st column in Table2(ie: Column2-0) not to accept any drops so that the cursor appears like a "No-Drop" cursor but with selection on the column cell during a drop action.
    Also when I move my cursor between "column2-0" and "column2-1",want to to have the "No-Drop" and "Drop" cursor to appear depending on the column.
    How can I achieve it using the TransferHandle class.Dont want to go the AWT way of implementing all the source and target listeners on my own.
    Have overridded the "CanImort" as follows:
    public boolean canImport(JComponent c, DataFlavor[] flavors) {
         JTable table = (JTable)c;      
    Point p = table.getMousePosition();
    /* if(p==null)
         return false;
    int selColIndex = table.columnAtPoint(p);
    if(selColIndex==0)
         return false;*/
    If I execute the above commented code,The "No-Drop" Icon appears in "column2-0",but no cell selection.Also If I move to "column2-1",which is the 1st column,Still get the "No-Drop" Icon there,also with no cell selection.
    for (int i = 0; i < flavors.length; i++) {
    if ((DataFlavor.stringFlavor.equals(flavors))) {
    return true;
    return false;
    Thanks in advance.....
    Edited by: Kohinoor on Jan 18, 2008 3:47 PM

    If you found the selection column based on the mouse pointer, then based on the column, you can set the cursor pointer as any one as below :
    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    setCursor(new Cursor(Cursor.HAND_CURSOR));

  • How to hide the cursor in text entry boxes

    I didn't see this answer in the forum, and it took a while to figure this out so I thought I'd post my
    solution.
    The issue is that a question requires that the user know where to click before typing, then type the correct value.
    The problem is that a text entry field shows the cursor; a dead give-away as to where the user is supposed to type.
    My solution is:
    1) Hide the text entry box (give it a name and uncheck 'Visible' in the options).
    2) Add a transparent button (with default text if needed) over the area where the user must click.
         - Set the 'Success' option to 'Show', and make the 'Show' item the name of your text entry box.
         - Disable all captions (unless they get points for clicking in the right place).
    3) Set the object timing so the button displays until clicked, then end the button display.  Start the display of the text entry field immediately after the end of the button display.
    The effect is that the user clicks the correct area, then the cursor displays in the correct location, ready for the text entry.

    Brilliant!
    You get a gold star for this idea.  Very original thinking.

  • How Do I Hide Mouse Pointer While Typing In Firefox

    Only in firefox, and only recently am I having problems typing anything through firefox, as the slightest touch of my laptops touch pad causes the mouse pointer to jump along with my typing cursor. This is causing major issues as I conduct all y business emails through firefox. If this cant be helped I will have to start using Internet Explorer Again. EVERY other program I use auto hides the mouse while typing, Except FF....
    == This happened ==
    Every time Firefox opened
    == Not sure, but I believe a week or so ago

    I have had the same problem despite having Hide Pointer When Typing checked in Mouse Properties. Damn annoying. I thought I finally found a solution with a free utility called "Park Cursor Aside" at http://www.makeuseof.com/dir/parkcursoraside-hide-mouse-cursor-when-typing/.
    Works great in Chrome and everywhere else EXCEPT Firefox. How about it Mozilla, are you are giving me another reason to switch over to Chrome? Please fix this. Thank you.

  • How do I hide the cursor while typing?

    I have it turned on in the Windows mouse settings. It hides in all other programs except Firefox. I have Win7 and Firefox 13.0.1

    I have had the same problem despite having Hide Pointer When Typing checked in Mouse Properties. Damn annoying. I thought I finally found a solution with a free utility called "Park Cursor Aside" at http://www.makeuseof.com/dir/parkcursoraside-hide-mouse-cursor-when-typing/.
    Works great in Chrome and everywhere else EXCEPT Firefox. How about it Mozilla, are you are giving me another reason to switch over to Chrome? Please fix this. Thank you.

  • Hide  the cursor when it not move?

    how to hide the cursor when it not move?
    i know how to creat a hide_cursor,but i want to hide it when the cursor not move and show it when it starts move again
    thank you!

    Create a javax.swing.Timer that has a 5 second initial
    delay, non-repeating. When it fires, it should hide
    the cursor (set to a blank cursor or whatever you have
    to do). Then on mouse motion events, you show the
    cursor and reset the timer.A good idea - is there no mouseNotMoved-event ?
    heres my sample-code:import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.MemoryImageSource;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class HiddenCursorListener extends MouseInputAdapter implements ActionListener {
         private static final Cursor HIDDEN_CURSOR =
              Toolkit.getDefaultToolkit().createCustomCursor(
                   Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(16, 16, new int[16 * 16], 0, 16)),
                   new Point(0, 0),
                   "HIDDEN_CURSOR");
         private static final Cursor DEFAULT_CURSOR = new Cursor(Cursor.DEFAULT_CURSOR);
         private Timer timer;
         private int timerDelay=1000;
         private Window window;
         public HiddenCursorListener(Window win) {
              window=win;     
         public void mouseEntered(MouseEvent e){
              startTimer();
         public void mouseMoved(MouseEvent e) {
              showCursor();
         public void mouseDragged(MouseEvent e) {
              showCursor();
         public void mouseClicked(MouseEvent e){
              showCursor();
         public void actionPerformed(ActionEvent e) {
              hideCursor();
         private void hideCursor(){
              if (window.getCursor() != HIDDEN_CURSOR)
                   window.setCursor(HIDDEN_CURSOR);
         private void showCursor(){
              if (window.getCursor() != DEFAULT_CURSOR)
                   window.setCursor(DEFAULT_CURSOR);
         private void startTimer(){
              timer = new Timer(timerDelay, this);
              timer.start();
         public static void main(String[] args) {
              JFrame f = new JFrame("Hidden-Cursor-Test");
              f.setSize(500, 500);
              f.setLocationRelativeTo(null);
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              HiddenCursorListener lis = new HiddenCursorListener(f);
              f.addMouseMotionListener(lis);
              f.addMouseListener(lis);
              f.setVisible(true);
    }regards

  • How can I hide the cursor?

    I want to hide the cursor if the mouse enter some Components or a JFrame.
    I tried to find methods to solve my problem, but I failed.
    Someone can tall me how to do? Thanks.

    One way to do this is to create a custom cursor based on a completely tranparent image. Then when you want to hide the cursor, set the cursor to the transparent one.
    ==================================================================
    * Create a 'hidden' cursor by using a transparent image
    * @return the invisible cursor
    Cursor createInvisibleCursor()
    Dimension bestCursorDim = Toolkit.getDefaultToolkit().getBestCursorSize(2, 2);
    BufferedImage transparentImage = new BufferedImage(bestCursorDim.width, bestCursorDim.height, BufferedImage.TYPE_INT_ARGB);
    Cursor hiddenCursor = Toolkit.getDefaultToolkit( ).createCustomCursor(transparentImage,
    new Point(1, 1),
    "HiddenCursor");
    return hiddenCursor;

Maybe you are looking for