java.awt

Class MouseInfo


  • public class MouseInfo
    extends Object
    MouseInfo provides methods for getting information about the mouse, such as mouse pointer location and the number of mouse buttons.
    Since:
    1.5
    • Method Detail

      • getPointerInfo

        public static PointerInfo getPointerInfo()
                                          throws HeadlessException
        Returns a PointerInfo instance that represents the current location of the mouse pointer. The GraphicsDevice stored in this PointerInfo contains the mouse pointer. The coordinate system used for the mouse position depends on whether or not the GraphicsDevice is part of a virtual screen device. For virtual screen devices, the coordinates are given in the virtual coordinate system, otherwise they are returned in the coordinate system of the GraphicsDevice. See GraphicsConfiguration for more information about the virtual screen devices. On systems without a mouse, returns null.

        If there is a security manager, its checkPermission method is called with an AWTPermission("watchMousePointer") permission before creating and returning a PointerInfo object. This may result in a SecurityException.

        Returns:
        location of the mouse pointer
        Throws:
        HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        SecurityException - if a security manager exists and its checkPermission method doesn't allow the operation
        Since:
        1.5
        See Also:
        GraphicsConfiguration, SecurityManager.checkPermission(java.security.Permission), AWTPermission
      • getNumberOfButtons

        public static int getNumberOfButtons()
                                      throws HeadlessException
        Returns the number of buttons on the mouse. On systems without a mouse, returns -1.
        Returns:
        number of buttons on the mouse
        Throws:
        HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        Since:
        1.5

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/awt/MouseInfo.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, MouseInfo

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut