< prev index next >

src/java.desktop/share/classes/java/awt/Component.java

Print this page




5928      * @return all of this component's {@code MouseWheelListener}s
5929      *         or an empty array if no mouse wheel
5930      *         listeners are currently registered
5931      *
5932      * @see      #addMouseWheelListener
5933      * @see      #removeMouseWheelListener
5934      * @since    1.4
5935      */
5936     public synchronized MouseWheelListener[] getMouseWheelListeners() {
5937         return getListeners(MouseWheelListener.class);
5938     }
5939 
5940     /**
5941      * Adds the specified input method listener to receive
5942      * input method events from this component. A component will
5943      * only receive input method events from input methods
5944      * if it also overrides {@code getInputMethodRequests} to return an
5945      * {@code InputMethodRequests} instance.
5946      * If listener {@code l} is {@code null},
5947      * no exception is thrown and no action is performed.
5948      * <p>Refer to <a href="{@docRoot}/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads"

5949      * >AWT Threading Issues</a> for details on AWT's threading model.
5950      *
5951      * @param    l   the input method listener
5952      * @see      java.awt.event.InputMethodEvent
5953      * @see      java.awt.event.InputMethodListener
5954      * @see      #removeInputMethodListener
5955      * @see      #getInputMethodListeners
5956      * @see      #getInputMethodRequests
5957      * @since    1.2
5958      */
5959     public synchronized void addInputMethodListener(InputMethodListener l) {
5960         if (l == null) {
5961             return;
5962         }
5963         inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l);
5964         newEventsOnly = true;
5965     }
5966 
5967     /**
5968      * Removes the specified input method listener so that it no longer




5928      * @return all of this component's {@code MouseWheelListener}s
5929      *         or an empty array if no mouse wheel
5930      *         listeners are currently registered
5931      *
5932      * @see      #addMouseWheelListener
5933      * @see      #removeMouseWheelListener
5934      * @since    1.4
5935      */
5936     public synchronized MouseWheelListener[] getMouseWheelListeners() {
5937         return getListeners(MouseWheelListener.class);
5938     }
5939 
5940     /**
5941      * Adds the specified input method listener to receive
5942      * input method events from this component. A component will
5943      * only receive input method events from input methods
5944      * if it also overrides {@code getInputMethodRequests} to return an
5945      * {@code InputMethodRequests} instance.
5946      * If listener {@code l} is {@code null},
5947      * no exception is thrown and no action is performed.
5948      * <p>Refer to
5949      * <a href="{@docRoot}/java.desktop/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads"
5950      * >AWT Threading Issues</a> for details on AWT's threading model.
5951      *
5952      * @param    l   the input method listener
5953      * @see      java.awt.event.InputMethodEvent
5954      * @see      java.awt.event.InputMethodListener
5955      * @see      #removeInputMethodListener
5956      * @see      #getInputMethodListeners
5957      * @see      #getInputMethodRequests
5958      * @since    1.2
5959      */
5960     public synchronized void addInputMethodListener(InputMethodListener l) {
5961         if (l == null) {
5962             return;
5963         }
5964         inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l);
5965         newEventsOnly = true;
5966     }
5967 
5968     /**
5969      * Removes the specified input method listener so that it no longer


< prev index next >