TipUtil.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:Tank 作者:
/**
 * Returns the default background color to use for tool tip windows.
 * 
 * @return The default background color.
 */
public static Color getToolTipBackground() {

    Color c = UIManager.getColor("ToolTip.background");

    // Tooltip.background is wrong color on Nimbus (!)
    if (c == null || UIManager.getLookAndFeel().getName().equals("Nimbus")) {
        c = UIManager.getColor("info"); // Used by Nimbus (and others)
        if (c == null) {
            c = SystemColor.info; // System default
        }
    }

    // Workaround for a bug (?) with Nimbus - calling JLabel.setBackground()
    // with a ColorUIResource does nothing, must be a normal Color
    if (c instanceof ColorUIResource) {
        c = new Color(c.getRGB());
    }

    return c;

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号