/** * Overridden to use the editor's background if it's detected that the * user isn't using white as the editor bg, but the system's tool tip * background is yellow-ish. * * @return The tool tip. */ @Override public JToolTip createToolTip() { JToolTip tip = super.createToolTip(); Color textAreaBG = textArea.getBackground(); if (textAreaBG!=null && !Color.white.equals(textAreaBG)) { Color bg = TipUtil.getToolTipBackground(); // If current L&F's tool tip color is close enough to "yellow", // and we're not using the default text background of white, use // the editor background as the tool tip background. if (bg.getRed()>=240 && bg.getGreen()>=240 && bg.getBlue()>=200) { tip.setBackground(textAreaBG); } } return tip; }
/** * Overridden to use the editor's background if it's detected that the * user isn't using white as the editor bg, but the system's tool tip * background is yellow-ish. * * @return The tool tip. */ @Override public JToolTip createToolTip() { JToolTip tip = super.createToolTip(); Color textAreaBG = textArea.getBackground(); if (textAreaBG!=null && !Color.white.equals(textAreaBG)) { Color bg = TipUtil.getToolTipBackground(); // If current L&F's tool tip color is close enough to "yellow", // and we're not using the default text background of white, use // the editor background as the tool tip background. if (bg.getRed()>=240 && bg.getGreen()>=240 && bg.getBlue()>=200) { tip.setBackground(textAreaBG); } } return tip; }