本文整理匯總了Java中javax.swing.JToolTip.setBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java JToolTip.setBackground方法的具體用法?Java JToolTip.setBackground怎麽用?Java JToolTip.setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JToolTip
的用法示例。
在下文中一共展示了JToolTip.setBackground方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
/**
* 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;
}
示例2: ToolButton
import javax.swing.JToolTip; //導入方法依賴的package包/類
/**
* Constructs a ToolButton object.
* @param toolName the name of the tool
* @param imageName the name of the tool button image
*/
public ToolButton(String toolName, String imageName) {
// Use JButton constructor
super(ImageLoader.getIcon(imageName));
// Initialize toolName
this.toolName = toolName;
// Initialize tool tip for button
toolButtonTip = new JToolTip();
toolButtonTip.setBackground(Color.white);
toolButtonTip.setBorder(new LineBorder(Color.yellow));
setToolTipText(toolName);
// Prepare default tool button values
setAlignmentX(.5F);
setAlignmentY(.5F);
}
示例3: createToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
@Override
public JToolTip createToolTip() {
JToolTip tooltp = new JToolTip();
tooltp.setBackground(SystemColor.control);
tooltp.setFont(getFont());
tooltp.setOpaque(true);
tooltp.setComponent(this);
tooltp.setBorder(null);
return tooltp;
}
示例4: createToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
@Override
public JToolTip createToolTip() {
JToolTip toolTip = super.createToolTip();
toolTip.setForeground(GuiStatics.COLOR_COOL_SPACE_BLUE);
toolTip.setBackground(GuiStatics.COLOR_COOL_SPACE_BLUE_DARK);
toolTip.setBorder(BorderFactory
.createLineBorder(GuiStatics.COLOR_COOL_SPACE_BLUE_DARKER));
return toolTip;
}
示例5: createToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
@Override
public JToolTip createToolTip() {
JToolTip tip = new JToolTip();
tip.setForeground(Color.BLACK);
tip.setBackground(Color.YELLOW);
tip.setFont(getFont());
return tip;
}
示例6: createToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
@Override
public JToolTip createToolTip()
{
JToolTip toolTip = super.createToolTip();
toolTip.setForeground(GuiStatics.COLOR_GOLD);
toolTip.setBackground(GuiStatics.COLOR_BLACK);
toolTip.setBorder(BorderFactory.createLineBorder(GuiStatics.COLOR_GOLD_DARK));
return toolTip;
}
示例7: createToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
/**
* 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.
*/
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;
}
示例8: getJuggleToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
final public static JToolTip getJuggleToolTip(ControlJFrame objPcontrolJFrame) {
final JToolTip objLjToolTip = new JToolTip();
objLjToolTip.setFont(objPcontrolJFrame.getFont());
objLjToolTip.setBackground(Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR);
return objLjToolTip;
}
示例9: createToolTip
import javax.swing.JToolTip; //導入方法依賴的package包/類
public JToolTip createToolTip() {
JToolTip tip = super.createToolTip();
tip.setBackground(Color.WHITE);
tip.setForeground(Color.BLACK);
return tip;
}