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

Similar Messages

  • Can I hide the cursor when screen sharing?

    I'd like to hide the cursor on the screen share device. Is that possible?

    You want to hide your cursor when sharing your screen?
    You could always hide the cursor in a corner of your monitor and then use keyboard commands to navigate your application, or, if you have second screen, leave your mouse cursor on the non-shared screen.
    There is no method of omitting your cursor from your screen share, as that is part of sharing your screen. There is the option to show the 'application' cursor, instead of the Connect Presenter cursor.
    Application cursor off:
    Application cursor on:

  • 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

  • Garage Band,  I am using an MBOX with a digi design audio core as a mic interface to recod into Garage Band.  Now when I Change the preferences to use the MBOX I can not move the recorder slider and there is no sound going into garage band?  Any solutions

    Garage Band,  I am using an MBOX with a digi design audio core as a mic interface to recod into Garage Band.  Now when I Change the preferences to use the MBOX I can not move the recorder slider and there is no sound going into garage band?  Any solutions

    10.5.8 with latest garageband 5.1 with MBOX 1. On Nov 4.09 I did a software update, now i get no output volume or input volume to the computer itself. I get it from head phones from my mbox, but not to the computer. Before the software update It worked great. I've tried upgrading software through digidesign .com, but they dont seem to have one for what i need. any way to get my old garage band back? go from 5.1 to earlier? Or maybe it was the upgrade to 10.5.8. update? Can i go back in time lol?
    Any help would be appreciated
    BTW
    Ive tried all the system sound prefs, and garage band drivers. Back and forth.
    cheers
    ds

  • After Yosemite Track pad moves the cursor but will NOT allow Click

    Track pad moves the cursor but will NOT allow click after a period of usage. After Forced reboot track pad works fine for a few hours. This started within hours of installing Yosemite. Help, I am afraid I will lose a document during reboot. So far I have been lucky and have not lost data.
    MacBook Pro (17-inch, Early 2011)  SSD

    Could be many things, we should start with this...
    If 10.7.0 or later...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.
    Any change on reboot?

  • How can I watch movies in germany with native tone, english? Any one knows how to switch the language when renting a movie?

    How can I watch movies in germany with native tone, english? Any one knows how to switch the language when renting a movie?

    I wonder the Format Tables macros on my site could be adapted?
    http://www.grainge.org/pages/authoring/word/word_macros.htm
    If not, I have used Macro Express to format tables in Rh. No reason it could not be used in Word.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Illustrator CS6: Missing small pixels box that should follow the cursor when creating objects

    Somehow I've managed to disable a feature in Illustrator CS6 that does two things: 1) it causes a small box to follow the cursor when I'm drawing an object 2) the light green lines or x's are gone now, too. How can I get them back? Are they only visible under certain circumstances?  Thanks!

    SmartGuides is not simply "on" or "off". It has settings for what displays. Check your SmartGuides preferences.
    JET

  • 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;

  • I have a Sony CDP-CX335. The door will not open and the turntable inside will not move

    Can someone please help me trouble shoot this issue. I have disconnected the power and turned back on, I have held the eject button for a minute+ with the unit on and off. The door still will not open automatically and the turntable inside will not move. There are no dics inside. When turned on the light flashes inside.

    Hi puffinparks,
    Please check the link below for further assistance.
    https://eservice.sony.com/webrma/web/index.do
    Thanks.
    >Joffrey
    If my post answers your question, please mark it as "Accept as Solution"

  • 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.

  • Itunes 11.1.3.8 shows a speaker icon in front of the seclection but it is not playing. the progress bar does not move. there are speakers attached to the system and all other programs do profuce an audio output.

    itunes 11.1.3.8 shows a speaker icon in front of the seclection but it is not playing. the progress bar does not move. there are speakers attached to the system and all other programs do profuce an audio output.

    Go to the Edit -> Preferences-> Playback
    In The bottom section of the page click the drop down menu by Play Audio Using and select Windows Audio Session or something other than "Direct sound" or whatever it displays. Click Okay. This worked for me! I hope it works for you too!
    Thanks,
    John

  • How do you fix the ipod when its not playing the music right when it makes noise

    How do you fix the ipod when its not playing the music right when it makes noise

    Hi Nicole,
    Try resetting it (nothing will be lost): Hold down the Home and Power buttons at the same time and continue to hold them down until the Silver Apple appears (up to 30 seconds). The Home screen should redisplay after the reset is complete.
    Cheers,
    GB

  • How do I change the speed of the cursor when using the arrow keys?

    How do I change the speed of the cursor when using the arrow keys?

    Applications folder or Apple icon > System preferences > Keyboard increase key repeat.

  • When scrolling bookmarks the cursor gets stuck on a bookmark and stays there even if I continue to move the cursor but does not happen if I slide to the subfolder.

    I am using a MacBook running OS 10.5.8 and using Firefox 3.6.10. When I scroll down my list of bookmarks the cursor will highlight a bookmark and although I continue to move the cursor the previously mentioned bookmark remains highlighted and the subfolder remains open. If I try to choose another bookmark, when I click the bookmarks disappear and I must reselect bookmarks again. The only way to select the bookmark I want is to carefully scroll down the edge of the bookmark folder an move the cursor into the bookmark. This does not occur when I get into a subfolder.

    Deleted it, restarted it. tried it again. no change. repeated the whole cycle. no change. thinking about uninstalling and reinstalling, but that won't reallyk change the settings.

  • When the video OPTION for MUSIC is selected - The Music Video does not move

    For a Movie, when the MUSIC option is selected, it does not move into the MUSIC library. It stays in the MOVIE category. It should to become a music video. How should it be done correctly?

    Thanks

Maybe you are looking for