How do I detect if the mouse button is down, outside of the applet?

Using
X = MouseInfo.getPointerInfo().getLocation().x;
Y = MouseInfo.getPointerInfo().getLocation().y;I can detect the mouse location anywhere on the entire screen, but after an extensive search on Google I cannot find any way to detect whether a mouse button is being pressed.
The class I am using is threaded, so I want to check each time to see if a mouse button is down (a simple true or false would be perfect).

coopkev2 wrote:
One website says to use the Control.MouseButtons property in Windows, is that possible to do in Java?I would pretty much forget about it, especially if you start to talk about "in OSWhatever it is done like this" - that makes it platform dependent and you can forget about platform specific stuff in the Java language itself - the only way to get something like that done is through a native library that you invoke using Java, using either JNI or JNA.

Similar Messages

  • Safari 5.1 flash mouse_leave not fired when mouse button is down

    Hi all, anyone know a work around for the fact that Event.MOUSE_LEAVE is not fired in Safari 5.1 (OSX 10.6.8) if the mouse button is down? I tried the latest beta player and the issue is not resolved. Thanks!

    WOT alerts you to dangerous web sites.
    That function is already built into Safari, and has been since version 3:
    http://www.macworld.com/article/137094/2008/11/safari_safe_browsing.html
    I had never heard of the WOT extension until today!
    If you go to Safari Preferences/Security you will see a box marked 'Warn when visiting a fraudulent website'. That is what that is.
    The blacklists from Google’s Safe Browsing Initiative (where Safari checks for 'fraudulent websites') are contained in a database cache file called SafeBrowsing.db  - the file was created when you first launched Safari, and if you have the browser open, the file is modified approximately every 30 minutes.

  • How can I disable right/left mouse buttons and scroll wheel in PDF?

    Hi all,
    I want the user to have to click on "forward" and "back" buttons that I've created in the PDF, in order to move around in it. Is there any way to disable the mouse buttons and scroll wheel from allowing users to go back and forth?
    Also, a separate question: I want the user to click on embedded images and receive either a pop-up comment, or be re-directed to another page in the PDF. Is there any way to set this up?
    Thanks for your time!

    You can achieve what you want in Question 1, just not via scripting.  You would need to create a plug-in in C/C++ that would be installed on the client machine.  Other than that option, try67 is correct - there is no way to achieve this from the document-level.

  • How can i detect if the picture or swf file is produced from legal flash?

    I have recently bought images and swf files from a student for my website.
    I've just realized that the images and swf might be from pirated flash product because i found out that
    the original flash is really and i mean really pricey! I don't believe he bought an original product.
    How do i detect if it is from a legal product? I'm worried as i'm going to put it in my website.
    I can't get the guy who did this for me as he is in another country already.
    If it is possible to detect this and it is indeed from pirated product, how can i make it legal again?
    Please help.

    Hey Rob,
    Its the same question, just that i want to know if it is possible to trace the source if the file is an image.
    If it is not possible to trace the source be it a swf or an image file, then i will just upload it to my website.
    I wouldn't bother to check if it came from a pirated flash product.
    The image is created from flash 8 just for me. It is not downloaded from another source.
    Thanks.

  • How Can I Detect Whether the User's Firefox Supports MHTML?

    Is there a browser capability property that I could look at to detect whether the user's version of Firefox (including, for instance, an "unMHT" add-on) supports MHTML? Currently we provide reports to our users in this format and want to provide a link to add-on's in case the user cannot actually view the format; but show the report if the add-on or capability is present.

    Sorry, you can't detect if a user has unMHT installed.
    Have you tested your MHTML files with Firefox and unMHT? <br />
    MHTML was never adopted as an official standard by W3C - http://en.wikipedia.org/wiki/MHTML - and from my limited usage of unMHT, it isn't exactly the same as what MS uses with IE. I have had problems displaying a file saved in one browser in another brand browser, and don't remember the specifics beyond IE8 won't correctly display unMHT files even when the file extension is changed from MHT to MHTML. Plus there's a 2nd add-on / extension - Mozilla Archive Format - that some users may have installed for MHTML files.

  • How to passing object to the applet?

    Dear All,
    My project is needed to read the xml file (include the form content) and then parse the xml file to create the related object, so using the applet to display this dynamic form.
    Due to cannot directly open the file object and the applet, the following is my idea:
    1. ) In the servlet, first to new the fileinputstream object , then pass the object into the applet. But this idea is not allowed.
    Only String value can use the param to to pass the parameter value to the applet using <param name = \"cis_auditID\" value = \""+inputsource+"\">.
    2. ) Firstly , read the file and then create specific object before call applet class. I know some people said that using the URLConnection, but i don't know for this. Can only one give more detail description about that.
    So how can i pass the fileinputstream or the own created object into the applet?
    Urgent! Please help!

    Where is the xml file located??
    If it's on the same server that serves the applet or if it's dynamically generated
    by making a http request to a servlet you should use URL and URLConnection.
    URL u = new URL(this.getCodeBase(),"../relativeDir/xmlFile.xml");
    URLConnection uc = u.openConnection();
    InputStream = uc.getInputStream();
    // read the rest of the struff.
    You might want to take a look at this example if you want to send (POST data) to
    the server when you make a http request to a servlet:
    http://forums.java.sun.com/thread.jspa?threadID=645830&tstart=0
    3rd post

  • How can you set a wired mouse to scroll down?

    My mouse is set to scroll horizontaly and vertically but it will only scroll up on a page, not down.  Is there any way I could fix this so my mouse can scroll down as well?

    A mouse that will scroll down but not up typically has a mouse ball with junk in it.
    To clean, turn upside-down and roll around on a rough-ish piece of clean white paper such as copy paper.

  • How can I detect if the  IMAP service is down ?

    I'm trying to figure out how to monitor when IMAP service down ?
    $ORACLE_HOME/bin/oesctl show status ${host_name}:um_system:imap
    However, this always shows that everythings fine.
    Is there a way of telling if it is not fine ?

    You can actually telnet to the IMAP server and issue some basic commands to see if it is responding. Try the following on the command line:
    telnet <your server> 143
    1 login <some user> <password>
    1 quitWhat you want to do is come up with something (like a script) that is scheduled to run and detects whether a valid response is returned every time.
    Edit: apologies, the "quit" should be "logout" as indicated below
    Message was edited by:
    david.chandler

  • How can I detect if the user "prefers" Qt or GTK?

    It sounds impossible, but I want to try.
    I'm thinking that a start might be reading the root window atoms in addition to the process list, but I'm not too sure what else.
    This goes beyond "the user's running {KDE,GNOME}"; I don't really want to figure out the windowmanager, I want to use deduction so as to figure out what toolkit the user would prefer something to use. The idea is then to compile both Qt and GTK toolkit calls into whatever given program along with a simple abstraction layer and the detection stuff, so I can from there figure out which toolkit to use at startup.
    I don't expect perfect detection, but it'd be fun to figure out.
    Ideas, anyone?
    My first stab at detecting a "GTK preference" is checking if the user is running gnome-session-manager. I'm not too sure what processes set "KDE session" apart from "a Qt-based program is running" because Qt has this tendancy to load 3874692725 things when anything starts and leave them preloaded for the next app. Nice idea, but not for low-RAM machines like mine. Only reason I haven't ravaged bits of KDE and stuffed them into my openbox desktop configuration
    -dav7
    Last edited by dav7 (2008-10-29 17:46:03)

    How about a environmental variable?
    You could have something like this is your .bashrc
    export MYTOOLKIT=qt
    or
    export MYTOOLKIT=gtk
    Then in your c-program you do something like this:
    char *toolkit;
    if ((toolkit = getenv("MYTOOLKIT")) == NULL) {
      fprintf(stderr, "-- 'MYTOOLKIT' not defined - required for this application (argv[0])\n");
      exit(1);
    if (!strcasecmp(toolkit, "qt")) {
    ; // qt-part
    } else if (!strcasecmp(toolkit, "gtk")) {
    ; // gtk-part
    edit: forgot a curly brace - duh!
    Last edited by perbh (2009-01-05 05:24:47)

  • How can i detected that the channel is closed with nio async?

    using nio, I can wait accept, read data, write data asynchronously.
    now i make a server program, and want to dected if a socket is closed by client, how can i do this?
    thanks.

    TO: ejp
    In TCP the only way you can detect a dead connection is to attempt to write to it.
    Eventually this will fail probably with a SocketException 'connection reset'.When should this happen? I don't seem to get any expection. The socket is registered for read only but it never gets read for reading again. The appropriate selection key indicates it is writable, but I don't have it registered for write operation.
    Isn't there any other way to get around those dead sockets without trying to write at them? This would be quite an overhead, since server has to send some check_alive message periodically...

  • How can I Fill up the applet form from VB code?

    Hi,
    I urgently required help in this issue.
    Please check the below URL :
    http://java.sun.com/applets/jdk/1.4/demo/applets/ArcTest/example1.html
    this is the sample i found on the java example page.
    What I want to do is?
    I want to opened that page in IE from VB. I did it by below code.
    Public WithEvents IE As SHDocVw.InternetExplorer
    Public WithEvents HtmDoc As HTMLDocument
    Private Sub CreateIE()
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = 1
    End Sub
    Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Set HtmDoc = IE.document
    End Sub
    Private Sub Navigate(URL)
    IE.Navigate URL
    End Sub
    Private Sub Command1_Click()
    CreateIE
    Navigate "http://java.sun.com/applets/jdk/1.4/demo/applets/ArcTest/example1.html"
    Call SetDocument
    End Sub
    Private Sub SetDocument()
    Set HtmDoc = IE.document
    For i = 0 To HtmDoc.getElementsByTagName("a").length
    List1.AddItem HtmDoc.All(i)
    Next i
    End Sub
    I just want to set the value of that two text box and then I want to click on that button.
    Is there any way that i can do it by getting the java applet content or by some another way?
    I downloaded the Java Activex Bridge. but i didn't found any solutions. I couden't understand that how can I use it.
    Please reply me as soon as possible as I am stuck on it. If possible send me sample project in VB 6.0 also for the same.
    Edited by: Sanket Shah on Feb 25, 2010 2:41 AM
    Edited by: SanketShah on Feb 25, 2010 2:43 AM
    Edited by: SanketShah on Feb 25, 2010 2:44 AM

    I'm certain that VB forums exist. I'm fairly certain that Microsoft would support them, so that's where I would look.
    But I would bet a fair amount of money that they'll tell you "That's a Java problem, ask on a Java forum". Let me just say that you can interface with an applet via Javascript (I haven't done it myself but you could look it up). Then your problem becomes how to execute Javascript from your VB code. That's probably askable on the VB forum.

  • How to detect if the display pdf in browser is checked for Adobe Acrobat 9

    How to programatically detect if the "Display PDF in browser" option is checked/unchecked in the Adobe Acrobat 9 Pro preferences? In earlier version it was possible to determine with navigator.plugins. Please help.

    Please update to the latest version of Adobe Reader i.e. 10.1.2 and enable the double sided printing as in the below figure:
    Hope this helps.
    Ankit

  • Epiphany and non-working back/foward mouse buttons

    Hi guys. I checked out and used the following wiki page to get my back/foward mouse buttons to work. It didn't work.
    https://wiki.archlinux.org/index.php/Al … ns_Working
    I have a Logitech M510 mouse. The back/foward buttons work in Chrome, Firefox and Midori but not Epiphany. How can I get them to work? I tried the following:
    Thumb Buttons - Forward and Back
    Note: The following maybe redundant depending on whether xev detects all your mouse buttons correctly (functions can be mapped on a per-app basis) or you want to change the default behaviour.
    To do this we need to map keystrokes to the desired mouse buttons and install xvkbd and xbindkeys.
    # pacman -S xvkbd xbindkeys
    In most modern applications which use back/forward features, XF86Back is mapped to back and XF86Forward is mapped to forward by default. On most MX mice the thumb buttons resolve to 8 & 9. If your mouse is different, check button numbers using xev and replace the numbers used in the example (b:8 & b:9).
    So if you have an MX mouse you would create the file ~/.xbindkeysrc, containing:
    # Mouse Buttons
    "xvkbd -xsendevent -text "\[XF86Back]""
    m:0x0 + b:8
    "xvkbd -xsendevent -text "\[XF86Forward]""
    m:0x0 + b:9
    Now to test... Run the following command and if it works as expected remember to add xbindkeys to .xinitrc or somewhere where it will be executed each time X starts. Also, this should work with Epiphany and Konqueror without any additional configuration or use of imwheel.
    Then I tried the xmodmap tweaking and that still didn't work. I'm not sure what to do next. I am starting to use epiphany more and more because firefox formatting isn't accurate on some sites I go to. Epiphany renders it correctly.
    When I add the device settings in xorg.conf, it wont allow me to start X. No screens found. My xorg.conf is blank other than what I was shown to put in there from the wiki page. So I'm completly lost.
    Last edited by xdunlapx (2011-06-07 03:44:41)

    Looks like this is a known BUG in Epiphany and apprently it's fixed for 3.8. Check https://bugzilla.gnome.org/show_bug.cgi?id=337852 for more information.

  • No backgroun and right mouse button xfce4

    Hello.
    Everything worked great so I decided to try Xgl. I put Shadowhand repo in my pacman.conf than I ran
    pacman -Syu
    and than
    pacman -S xgl-cvs compiz-cvs mesa-cvs cairo-cvs
    first I lost my right mouse button menu and than background. I recovered bacground by running
    xfdesktop in terminal. How do I get my right mouse button working? This is when I run startxfce4 as root. When I try as other user everything work like before. Thanks for help.
    Andrey

    it sounds like one of the dot files that xfce4 stores it's config files in is corrupt. besides that, you shoulden't run as root anyway

  • Xfce4 no background and right mouse button menu

    Hello.
    Everything worked great so I decided to try Xgl. I put Shadowhand repo in my pacman.conf than I ran
    pacman -Syu
    and than
    pacman -S xgl-cvs compiz-cvs mesa-cvs cairo-cvs
    first I lost my right mouse button menu and than background. I recovered bacground by running
    xfdesktop in terminal. How do I get my right mouse button working? This is when I run startxfce4 as root. When I try as other user everything work like before.
    I tried to remove xfce4 and install again. I tried to remove .config directory from root folder and replace with one from users on the system(startxfce4 as user everything is there). Still the same black background and no menu on right mouse button.
    Thanks for help.
    Andrey

    Thanks. Worked for me also. What a great distro it is. This is like coming back to basics but everything works + great community.
    Andrey

Maybe you are looking for

  • Can I use an internal drive or external only?

    It seems you need a very large (1TB) drive dedicated to Time Machine. As internal storage is always cheaper, would an internal non-boot drive in the additional PCI slot work for Time Machine, specifically will it see an internal drive or only externa

  • Reading data from a text file into a JTextField

    So I am writing a program that will write to and read from a large database. I was hoping to allow a graphical interface for the reading of the data, but I keep getting an error; Incompatible Types Found: java.lang.string Required: javax.swing.JTextF

  • Upgrade 9i to 10g Performance Issue

    Hi All, DBA team recently upgraded the database from 9i to 10g (Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi). There is a process as follows Mainframe --> Flat file --> (Informatica) --> Oracle DB --> (processing through SPs) -->

  • What's the better approach?

    Hi, I was just making a program that access a DB through JDBC, and I got myself into this dilemma What's the better approach to make a connection to a DB? approach #1(use of singleton pattern) import java.sql.*; public class DBConnection {     privat

  • Like in 9.2.0.6 versus 9.2.0.4

    after migration from 9.2.0.4 to 92.0.6 we have the following problem: select * from art where art_nummer like '753040204' ok in 9.2.0.4 no results in 9.2.0.6 select * from art where art_nummer = '753040204' ok iin auf 9.2.0.4 ok in 9.2.0.6 the column