Java Swing LineBorder getToolTipBorder()

Here you can find the source of getToolTipBorder()

Description

Returns the border used by tool tips in this look and feel.

License

BSD License

Return

The border.

Declaration

public static Border getToolTipBorder() 

Method Source Code

//package com.java2s;
/*/*from w ww.  j  a  v  a 2  s .c  om*/
 * 08/13/2009
 *
 * TipUtil.java - Utility methods for homemade tool tips.
 *
 * This library is distributed under a modified BSD license.  See the included
 * RSyntaxTextArea.License.txt file for details.
 */

import java.awt.SystemColor;
import javax.swing.BorderFactory;

import javax.swing.UIManager;
import javax.swing.border.Border;

public class Main {
    /**
     * Returns the border used by tool tips in this look and feel.
     *
     * @return The border.
     */
    public static Border getToolTipBorder() {

        Border border = UIManager.getBorder("ToolTip.border");

        if (border == null || isNimbusLookAndFeel()) {
            border = UIManager.getBorder("nimbusBorder");
            if (border == null) {
                border = BorderFactory.createLineBorder(SystemColor.controlDkShadow);
            }
        }

        return border;

    }

    /**
     * Returns whether the Nimbus Look and Feel is installed.
     *
     * @return Whether the current LAF is Nimbus.
     */
    private static boolean isNimbusLookAndFeel() {
        return UIManager.getLookAndFeel().getName().equals("Nimbus");
    }
}

Related

  1. drawBorders(final JPanel panel)
  2. getBorderBlue()
  3. getDefaultLineBorder()
  4. getLineBorder()
  5. getMandatoryBorder()
  6. intToBorder(int borderConstant)
  7. isAtScrollPaneRightBorder(Component c, int x)
  8. lineBorder(JComponent comp)
  9. recursiveAddBorderToPanel(JComponent c)