src/share/classes/java/awt/Toolkit.java

Print this page




2573     }
2574 
2575     /**
2576     * Reports whether events from extra mouse buttons are allowed to be processed and posted into
2577     * {@code EventQueue}.
2578     * <br>
2579     * To change the returned value it is necessary to set the {@code sun.awt.enableExtraMouseButtons}
2580     * property before the {@code Toolkit} class initialization. This setting could be done on the application
2581     * startup by the following command:
2582     * <pre>
2583     * java -Dsun.awt.enableExtraMouseButtons=false Application
2584     * </pre>
2585     * Alternatively, the property could be set in the application by using the following code:
2586     * <pre>
2587     * System.setProperty("sun.awt.enableExtraMouseButtons", "true");
2588     * </pre>
2589     * before the {@code Toolkit} class initialization.
2590     * If not set by the time of the {@code Toolkit} class initialization, this property will be
2591     * initialized with {@code true}.
2592     * Changing this value after the {@code Toolkit} class initialization will have no effect.
2593     * <p>
2594     * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
2595     * @return {@code true} if events from extra mouse buttons are allowed to be processed and posted;
2596     *         {@code false} otherwise
2597     * @see System#getProperty(String propertyName)
2598     * @see System#setProperty(String propertyName, String value)
2599     * @see java.awt.EventQueue
2600     * @since 1.7
2601      */
2602     public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
2603         GraphicsEnvironment.checkHeadless();
2604 
2605         return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();
2606     }
2607 }


2573     }
2574 
2575     /**
2576     * Reports whether events from extra mouse buttons are allowed to be processed and posted into
2577     * {@code EventQueue}.
2578     * <br>
2579     * To change the returned value it is necessary to set the {@code sun.awt.enableExtraMouseButtons}
2580     * property before the {@code Toolkit} class initialization. This setting could be done on the application
2581     * startup by the following command:
2582     * <pre>
2583     * java -Dsun.awt.enableExtraMouseButtons=false Application
2584     * </pre>
2585     * Alternatively, the property could be set in the application by using the following code:
2586     * <pre>
2587     * System.setProperty("sun.awt.enableExtraMouseButtons", "true");
2588     * </pre>
2589     * before the {@code Toolkit} class initialization.
2590     * If not set by the time of the {@code Toolkit} class initialization, this property will be
2591     * initialized with {@code true}.
2592     * Changing this value after the {@code Toolkit} class initialization will have no effect.
2593     *
2594     * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
2595     * @return {@code true} if events from extra mouse buttons are allowed to be processed and posted;
2596     *         {@code false} otherwise
2597     * @see System#getProperty(String propertyName)
2598     * @see System#setProperty(String propertyName, String value)
2599     * @see java.awt.EventQueue
2600     * @since 1.7
2601      */
2602     public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
2603         GraphicsEnvironment.checkHeadless();
2604 
2605         return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();
2606     }
2607 }