Java JComponent Container getInputHint(JComponent comp)

Here you can find the source of getInputHint(JComponent comp)

Description

Returns the component's input hint that is stored in a client property.

License

Open Source License

Parameter

Parameter Description
comp the component to be requested

Return

the component's input hint

Declaration

public static Object getInputHint(JComponent comp) 

Method Source Code

//package com.java2s;

import javax.swing.JComponent;

public class Main {
    /**//ww w  . jav a  2s. c  o  m
     * The JComponent client property key for the input hint text. The text stored under this key is intended to be displayed if and only if the component has the focus.
     * 
     * @see #getInputHint(JComponent)
     * @see #setInputHint(JComponent, Object)
     */
    private static final String INPUT_HINT_KEY = "validation.inputHint";

    /**
     * Returns the component's input hint that is stored in a client property. Useful to indicate the format of valid data to the user. The input hint object can be a plain <code>String</code> or a
     * compound object, for example that is able to localize the input hint for the active {@link java.util.Locale}.
     * <p>
     * 
     * To make use of this information an editor should register a listener with the focus management. Whenever the focused component changes, the mechanism can request the input hint for the focus
     * owner using this service and can display the result hint in the user interface.
     * 
     * @param comp
     *            the component to be requested
     * @return the component's input hint
     * 
     * @see #setInputHint(JComponent, Object)
     */
    public static Object getInputHint(JComponent comp) {
        return comp.getClientProperty(INPUT_HINT_KEY);
    }
}

Related

  1. getDeepestEmptyComponentAt(JComponent parent, Point location)
  2. getFirstChildComponentOfType(Component component, Class childComponentType)
  3. getGlassPane(JComponent comp)
  4. getGtkStyle(Object styleFactory, JComponent component, String regionName)
  5. getGtkStyle(Object styleFactory, JComponent component, String regionName)
  6. getInsetBounds(JComponent comp)
  7. getInterior(JComponent comp)
  8. getLocalInsetBounds(JComponent component)
  9. getMandatoryPanel(JComponent c)