Display Mouse pointer coordinates

Hi all
I have an Applet that implements MouseListener and MouseMotionListener events.
In mousePressed() method i'm writing code to draw a point on the location where the mouse was pressed.
In mouseMoved() method (the problem) I'm trying to write code so that the coordinates of the mouse pointer are displayed...I managed to do the following :
int xMove,yMove;
  public void mouseMoved(MouseEvent e) {
       Graphics g=getGraphics();
     //erase old mouse location coordinates
        g.setColor(this.getBackground());
        g.drawString("+",xMove,yMove);
        g.drawString(""+Integer.toString(xMove)+","+Integer.toString(yMove)+"",xMove+10,yMove-10);
       xMove = e.getX();
       yMove = e.getY();
    //paint new mouse location coordinates
       g.setColor(Color.black);
       g.drawString("+",xMove,yMove);
       g.drawString(""+Integer.toString(xMove)+","+Integer.toString(yMove)+"",xMove+10,yMove-10);
  }the prroblem of this method is that when i move pointer over an already painted point ; this point is erased from the screen !
I want the mouse pointer to be showed over all painted shapes on my applet.
can you give me a hint on how to do that ?
many thanks.

thanks guys , I managed to solve the problem myself.
I can tell how i did it if someone wants to get the point.
Thanks again for your time.
regards.

Similar Messages

  • External display won't show the mouse pointer (optical)

    hi all,
    13" display dimming my old eyes . decided to connect to 20" sony monitor. got the adapter > connected> display shows identical to laptop BUT no mouse pointer AND when the external monitor is displaying, the menubar is not longer existent on the powerbook (the trackpad does work on the laptop screen with external connected ) so I cannot get to the display preferences to set anything up to get the mouse pointer to show on the external monitor.
    HELP and thanks
    sue

    ok folks, fiddled since I wrote this and managed to actually get it going ! so all set.
    I'm up and running with the display. and all is dandy !
    Message was edited by: Sue brown1

  • After upgrade I have a black display showing only the mouse pointer

    I just installed the Windows 10 Technical Preview on my Lenovo W540 laptop.  The installation appeared to to go just fine and I did not see anything that should cause any issues.  Now that it is complete, my display is black and I see the mouse
    pointer on the screen.  I can move the mouse just fine, but nothing else will display when moving the mouse.  If I hit <ctrl><alt><del> then our domain banner page will flash on the display but I can't hit the OK button to get to
    my login prompt.  Has anyone seen this before?  What can I do to resolve this issue?  Any suggestions out there?
    Wade Preston

    I just connected remotely to the Applicaiton log files via computer management.  I see that the LogonUI.exe application is failing.  I have attached the log for this error.  Anyone know what to do with this error or how to fix it?
    Here is the log:
    Log Name:      Application
    Source:        Application Error
    Date:          10/2/2014 11:07:55 AM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      BF03500KL.baldwin.corp
    Description:
    Faulting application name: LogonUI.exe, version: 6.4.9841.0, time stamp: 0x5413b9b7
    Faulting module name: MSVCR100.dll, version: 10.0.40219.1, time stamp: 0x4d5f034a
    Exception code: 0xc0000005
    Fault offset: 0x000000000003645a
    Faulting process id: 0x1244
    Faulting application start time: 0x01cfde5b066a2697
    Faulting application path: C:\WINDOWS\system32\LogonUI.exe
    Faulting module path: C:\WINDOWS\SYSTEM32\MSVCR100.dll
    Report Id: 44725ffb-4a4e-11e4-95d5-54ee7501cb36
    Faulting package full name: 
    Faulting package-relative application ID: 
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-10-02T16:07:55.000000000Z" />
        <EventRecordID>48596</EventRecordID>
        <Channel>Application</Channel>
        <Computer>BF03500KL.baldwin.corp</Computer>
        <Security />
      </System>
      <EventData>
        <Data>LogonUI.exe</Data>
        <Data>6.4.9841.0</Data>
        <Data>5413b9b7</Data>
        <Data>MSVCR100.dll</Data>
        <Data>10.0.40219.1</Data>
        <Data>4d5f034a</Data>
        <Data>c0000005</Data>
        <Data>000000000003645a</Data>
        <Data>1244</Data>
        <Data>01cfde5b066a2697</Data>
        <Data>C:\WINDOWS\system32\LogonUI.exe</Data>
        <Data>C:\WINDOWS\SYSTEM32\MSVCR100.dll</Data>
        <Data>44725ffb-4a4e-11e4-95d5-54ee7501cb36</Data>
        <Data>
        </Data>
        <Data>
        </Data>
      </EventData>
    </Event>
    Wade Preston

  • How to find mouse coordinates when mouse pointer is outside of app screen?

    Hello folks,
    Does anyone know, how in a Swing/AWT app to find out the screen coordinates
    of the mouse pointer when the mouse pointer is outside of the app screen?
    Would appreciate your comments.
    Tim

    MouseInfo does work - thanks a lot for your hint!
    I wasn't aware of this class actually because normally use 1.4.2.
    Good time to switch :-)

  • Display hour glass mouse pointer

    Hi all!
    Does anyone know how to make the mouse pointer into a hour glass pointer? After clicking the "Load" button in the application, it takes a long time to display the contents. So I thought of informing the user that he has to wait for it to display the data.
    Anyone know?
    -KAren-

    try the following line when you respond to the button press:
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    But don't forget - you need to change it back when you are done ;-) To change it back:
    setCursor(Cursor.getDefaultCursor);
    Hope that helps.

  • When a link is rolled over by the mouse pointer a very annoying pop up with the link address shows up. There seems to be no way to prevent this from happening. How can this pop up be made to go away?

    no matter what website, every time I move the mouse pointer over something to click on a line of black printing in a thin white box pops up at the bottom of the screen and shows me the http address of the item I'm about to click on. I want to shut this function off or remove it if possible. I find that the previous version did not do this, it seems to be unique to 6.0. It's VERY distracting and ANNOYING. How can I make it go away????

    When you hover the mouse cursor over any link, it will display the link details at the bottom left of the screen; black font on white background.
    This display can be very important as it shows the full address of the hyperlink. This can be particulary useful for checking on whether the link is bona-fida. For example; if you receive an email that looks like it is from a bank , hovering over the link will indicate instantly that the link is pretending to be something it isn't.
    Another example that can be useful; a website link may say 'contact me' rather than give the actual email address. However, when you hover over the link, the actual email address will be displayed at the bottom of the screen. If you click on the link then Outlook usually opens, however I do not use Outlook, so displaying the email address is useful.
    This display is something that has always been present and it is also displayed if you use IE.
    However, I can see that this annoys you, so you could try the following:
    [[https://addons.mozilla.org/en-US/firefox/addon/link-location-bar/?src=api]]
    After installing the addon, you will need to restart Firefox, then go to History and Restore previous session to get all your tabs and webpages back.
    You will now find that when you hover over any link, it will now display in your address bar on the right hand side.
    If this helps, please say this question has been solved.

  • Mouse pointer invisible - intel 945GM

    Hey people, thought I would document this in case others have problems.  I have partially solved the issue, but if someone knows a better solution please contribute.  I think this is specific to the intel xorg driver but not totally sure.
    I rebooted my eeepc (Intel 945GM, using stock driver) today and when I got into X there was no mouse pointer.  I quickly found that the mouse is in fact there, you can right-click and get a menu etc, its just there is no pointer so your flying blind.
    A bit of Googling suggested it was something to do with using xrandr to enable/disable outputs, which is what I do.  At home the eeepc sits on the desk connected to my external monitor.  In my .xinitrc I have it set up so it detects when its connected to the monitor and automatically enables it (VGA) and disables the laptop screen (LVDS).
    So to try and get the mouse back I re-enabled the LVDS
    xrandr --output LVDS --auto
    The eeepc screen comes back on (in clone mode) and sure enough the mouse pointer is visible on that screen, but not on the external VGA.  After a bit of tooling around I found that if you enable both screens in extended desktop mode, the pointer is then visible on both.
    xrandr --output LVDS --right-of VGA --auto
    Once the pointer is working on both screens you can then turn off the LVDS again, and the pointer remains working on the external, everything back to normal.
    xrandr --output LVDS --off
    PART 2 - This is actually a question if anyone can help me
    In order to use dual monitors like an extended desktop, you will find that you need to set the virtual desktop size in your xorg.conf display section.  Something like:
    virtual 2304 1024
    BUT...since we now bask in the glory that is hot-plugging and hal wizardry, I don't have an xorg.conf.  Does anyone know how to set the virtual framebuffer size using xrandr, without having to use an xorg.conf?
    And while I think about it, why do we even need to set a virtual size manually really, xorg knows the dimensions of connected displays, you would think it could set a default virtual framebuffer to the width of the connected outputs, would make it much easier. /rant
    Anyway, any more info on the subject much appreciated.
    Last edited by Wittfella (2009-10-22 14:36:09)

    The cursor issue sounds like an upstream bug - you should report it to https://bugs.freedesktop.org.
    Wittfella wrote:Does anyone know how to set the virtual framebuffer size using xrandr, without having to use an xorg.conf?
    Can't be done.  The virtual fb size tells your graphics driver how big a framebuffer to allocate at X start time.  It can't be changed later.  Which is too bad, and a major limitation of randr.  I think it does set the virtual fb size correctly when it starts, but that size will be wrong when you add another monitor for example.

  • Lenovo think pad S230u Black screen with mouse pointer after log in

    Hello I dont know if i am on the right board for this but this is the first time i am posting on here. I have a Lenovo think pad S230u. Recently it will load up to the screen where you put in your password and let you put it in your password but then just loads to a all black screen with just a mouse pointer on it thats it. I read on line that some other thinkpads had this issue with a display driver but i couldnt find anything on the one i have. The one i have is running windows 8. Any help is greatly appericated. 

    Hi Lsaacw,
    Welcome to Lenovo Community!
    As per the query we understood that you are facing an issue with No Boot to Windows 8 on your ThinkPad S230u.
    Please check if the system is able to boot to ‘safe mode’.
    Please click here to know the procedure on how to boot the system into ‘safe mode’.
    Perform clean boot in safe mode and restart the system to check.
    Hope this helps!
    Best regards,
    Hemanth Kumar
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Has anyone had a problem with a stuck mouse pointer?

    The mouse pointer on my System recently started behaving oddly. The pointer works fine while the iMac boots. Once the boot is fully completed, the pointer is effectively stuck at the bottom of the display (before I launch any application). It is kinda like it is on a rubber band. If I move it quickly, it moves across the whole screen and then gets reset to the bottom of the display. If I move it slowly, it moves half an inch or less on screen and gets yanked back. If I boot into Safe Mode, the mouse pointer works normally. If I boot normally, but log into a different account, everything works fine. But for my primary account, the mouse pointer is messed up. I have run Norton and it finds no viruses or malware. I have run MacScan and it finds no malware.

    Something must have worked - just got an E-mail from MacAce saying they've seen the problem and are arranging a refund.

  • Why the mouse pointer in Logic Pro does not change shape during work in OSX 10.9.1?

    I've a MacBook Pro Retina 15-inch Late 2013 and I'm using two external displays. One connected to to the HDMI port (display 1) the other to thunderbolt (display 2). The MacBook display is closed. I’m working with Logic Pro 9.1.8 (32bit) with OSX 10.9.1
    Why the mouse pointer in Logic Pro does not change shape during work???
    It was already difficult with OSX 10.9 but now after upgrading to 10.9.1 it's game over!
    At least before I could select which display use Logic Pro to have all the shape functions of the pointer. Not in both displays, so to be forced to edit in ONLY ONE of the two displays using this workaround: (right click on Logic icon in Dock: Option --> Desktop on Display 1). Now or I select “Option --> All Desktops” or does not work. However, by selecting all displays you say goodbye to Mission Control. This can’t be a solution!!!
    The amazing thing is that Nuendo has no problem while Logic Pro, Apple's native software, it can't!
    With Nuendo it’s indifferent in which display you are working, the shape of the mouse pointer changes shape depending on the requirement in both displays.
    This thing drives me crazy!
    Solutions?
    Here some ideas in other foums:
    http://www.logicprohelp.com/forum/viewtopic.php?f=1&t=86264
    But this aren't really solutions but workarounds. Use Logic in all desktops makes Mission Control useless!!

    I installed all over again by formatting as suggested by the genes of pro application support. Each plug-in, each virtual instrument, a job that lasted 3 days. And as suggested for each new plug-in I proceeded to check the proper functioning of Logic Pro and did each time a back up with Time Machine.
    The Result:
    Logic works as it should ONLY on the primary monitor and ONLY on the first desktop.
    BUT
    Reason and Nuendo dont' have this issue !!
    I believe that Apple developers are thinking only to mobile phones and things like messages or face time.
    And that's not all!
    After a few weeks, perhaps by installing a version of Adobe Acrobat, I say maybe because I'm not sure, logic has stopped working properly. Again problems with the mouse pointer.
    Luckily I had a back up! But now I'm terrified to install new programs. Thanks Apple!

  • How to get Mouse Screen Coordinates

    Hi
    I have code:
    JButton btn  = new JButton("button");
    btn.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent e)
              //  HEAR I WANT TO GET MOUSE
              //  SCREEN COORDS!!!
    }I want to get Coordinates!!!

    If you have a MouseEvent you can convert it as follows:
    Point point = mouseEvent.getPoint();
    SwingUtilities.convertPointToScreen((Component)mouseEvent.getSource(), point);However, that won't work from your actionPerformed method. If possible, use a MouseListener and intercept the mousePressed/mouseClicked events.
    If you want to capture the mouse position when someone presses a button (e.g, by using an keyboard shortcut) then you'll need a MouseMotionListener to track the mouse pointer as it moves over your component.
    Hope this helps.

  • How to change mouse pointer to Arrow?

    When we move the mouse over any component in preview (or in SWF file), mouse pointer changes to u201Chandu201D. Is it possible to keep the mouse pointer to Arrow or any other custom mouse pointer in Xcelsius 2008 SP 4?
    Thanks

    Mouse over cursor is set to ARROW if the component is not selectable
    Eg:pie chard which has no drill down or no furthur selection is enabled then the mouse over by default is ARROW.
    If you have enabled any furthur selection for that component the by default mouseover is HAND .
    This holds good for all the components in Xcelsius (even in sp4) Except for tab set container component where the selection of tabs is displayed with Arrow  symbol.
    New features that sp4 provides is 1)Waterfall chart 2)Alerts are  supported for spreadsheet tables, and for
    combination charts.
    @Sri

  • W530, W7-64: external monitor is dark except for mouse pointer

    Hello,
    I'm starting to experience this problem. Initially I had no problems with using an external monitor, but now I cannot use it. When I switch to the external monitor, the screen is dark, except for the mouse pointer which moves correctly.. Anyone know the cause of this problem?
    Regards,
    bostjanv

    I have had same problems using NVIDA Q2000K when using Windows 8.  Try configuring with NVIDA instructions for multiple displays as follows: 
     ThinkPad W530       NVIDIA Quadro K1000M or NVIDIA Quadro K2000M           - Computer's analog VGA connector           - Docking Station's analog VGA connector           - Computer's DisplayPort connector           - Docking Station's DVI connector(s) or DisplayPort connector(s)
          Intel HD Graphics Family           - (Computer's LCD)
    DUAL ADAPTER CLONE
      Dual Adapter Clone is a technology where display output from one display   adapter is cloned to another display adapter. This feature is unique for   NVIDIA Optimus Technology starting from second generation Optimus technology.   The only difference between cross adapter clone and traditional clone is that   the former involves two display adapters while the latter involves only one.
    HOW TO CONFIGURE DUAL ADAPTER CLONE
      Dual Adapter Clone is only supported and be configured in NVIDIA Control Panel.   As an example, the procedure below describes the steps on how to configure the   dual adapter clone. Remember that the dual adapter clone involves two   different graphics devices, so the 'Display Topology' section above will give   you an idea which combinations can support dual adapter clone, otherwise, it   is considered as a traditional clone.
      The procedure below assumes to use the LCD and DisplayPort monitor connected   to the computer.   1. Attach a DisplayPort monitor to the computer.   2. Open the NVIDIA Control Panel, and on the left pane, select 'Setup multiple      displays' under 'Display' tree.   3. On the right panel, under 'Select the display you want to use', check both      LCD and DisplayPort monitor.   4. Under 'Verify your display configuration', right click on either the LCD or      DisplayPort display icon.   5. Select 'Duplicate with 1 (use 2 as source)' then click Apply.
      Note: The Dual Adapter Clone can not be enabled by using the Windows display         control panel or the Intel's display control panel.
    Windows 8 also disabled my NVIDA Q2000K and I had to restore it.  I hope this was helpful.
    Jack
    Jack

  • Catalyst: Mouse Pointer looks weird on one monitor

    Hi, i just installed a fresh Arch system (2.6.35-ARCH) and I'm using Xorg (1.9.0) together with the AUR-package "catalyst-test". Now when i start up a desktop environment (i tryd twm and openbox), my mouse pointer looks weird on my right monitor but normal on my left, which is my primary.
    Right Monitor (the square on the left is my mouse pointer)
    When i tryd to make a screenshot of the problem the image just showed me the mouse pointer as its supposed to be, so i had to make this picture with a camera. The mouse pointer is fully functional just its look is broken. I never had this bug before when using the same hardware together with Arch. When I changed my xorg.conf so that my right monitor is the primary one, the mouse pointer looks weird on the left but is okay on the right.
    xorg.conf:
    Section "ServerLayout"
    Identifier "aticonfig Layout"
    Screen 0 "aticonfig-Screen[0]-0" 0 0
    Screen "aticonfig-Screen[0]-1" RightOf "aticonfig-Screen[0]-0"
    EndSection
    Section "Module"
    EndSection
    Section "ServerFlags"
    Option "Xinerama" "on"
    EndSection
    Section "Monitor"
    Identifier "aticonfig-Monitor[0]-0"
    Option "VendorName" "ATI Proprietary Driver"
    Option "ModelName" "Generic Autodetecting Monitor"
    Option "DPMS" "true"
    EndSection
    Section "Monitor"
    Identifier "aticonfig-Monitor[0]-1"
    Option "VendorName" "ATI Proprietary Driver"
    Option "ModelName" "Generic Autodetecting Monitor"
    Option "DPMS" "true"
    EndSection
    Section "Device"
    Identifier "aticonfig-Device[0]-0"
    Driver "fglrx"
    Option "DesktopSetup" "horizontal"
    Option "Capabilities" "0x00000800"
    BusID "PCI:1:0:0"
    EndSection
    Section "Device"
    Identifier "aticonfig-Device[0]-1"
    Driver "fglrx"
    BusID "PCI:1:0:0"
    Screen 1
    EndSection
    Section "Screen"
    Identifier "aticonfig-Screen[0]-0"
    Device "aticonfig-Device[0]-0"
    Monitor "aticonfig-Monitor[0]-0"
    DefaultDepth 24
    SubSection "Display"
    Viewport 0 0
    Depth 24
    Modes "1600x1200"
    EndSubSection
    EndSection
    Section "Screen"
    Identifier "aticonfig-Screen[0]-1"
    Device "aticonfig-Device[0]-1"
    Monitor "aticonfig-Monitor[0]-1"
    DefaultDepth 24
    SubSection "Display"
    Viewport 0 0
    Depth 24
    Modes "1600x1200"
    EndSubSection
    EndSection
    Last edited by aXyde (2010-10-10 18:34:37)

    Radioactiveman wrote:Please inform yourself before writing these comments.
    Catalyst-test is compatible with xorg-server 1.9, otherwise there would be just a blank screen ...
    I'll keep that in mind, thanx for your helpul comment.

  • Focus on mouse pointer on click- WPF

    hi,
    I want to focus the position of the mouse pointer when the user clicks.
    Exactly like the focus we get on clicking the ctrl key to locate mouse pointer after enabling it here.
     Can anyone help me with this.
    Thanks,
    Shaleen
    TheHexLord

    Hi TheShaleen,
    >>I want to focus the position of the mouse pointer when the user clicks
    It's hard to accomplish your requirement, I've tried to find API to enable this setting, but as far as I know, there is no official API to enable this programmatically.
    If you just want to make this work on some control, like Canvas, you could get the coordinate of Mouse Pointer and draw shap on this Canvas, please refer to this article:
    http://msdn.microsoft.com/en-us/library/ms747393(v=vs.110).aspx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for