Example usage for javax.swing JSpinner getToolTipText

List of usage examples for javax.swing JSpinner getToolTipText

Introduction

In this page you can find the example usage for javax.swing JSpinner getToolTipText.

Prototype

public String getToolTipText() 

Source Link

Document

Returns the tooltip string that has been set with setToolTipText.

Usage

From source file:GrayModel.java

protected void updateToolTipText(JSpinner spinner) {
    String toolTipText = spinner.getToolTipText();
    if (toolTipText != null) {
        // JSpinner has tool tip text. Use it.
        if (!toolTipText.equals(getToolTipText())) {
            setToolTipText(toolTipText);
        }//w w w .ja  va2  s  . co  m
    } else {
        // Define our own tool tip text.
        GrayModel myModel = (GrayModel) (spinner.getModel());
        int rgb = myModel.getIntValue();
        setToolTipText("(" + rgb + "," + rgb + "," + rgb + ")");
    }
}