Here you can find the source of getInputHint(JComponent comp)
Parameter | Description |
---|---|
comp | the component to be requested |
public static Object getInputHint(JComponent comp)
//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); } }