本文整理匯總了Java中javax.swing.JToolTip.setBorder方法的典型用法代碼示例。如果您正苦於以下問題:Java JToolTip.setBorder方法的具體用法?Java JToolTip.setBorder怎麽用?Java JToolTip.setBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JToolTip
的用法示例。
在下文中一共展示了JToolTip.setBorder方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: createTipContent
import javax.swing.JToolTip; //導入方法依賴的package包/類
private JComponent createTipContent(String tipText, DebuggerTreeNodeImpl node) {
final JToolTip tooltip = new JToolTip();
if (tipText == null) {
tooltip.setTipText(tipText);
}
else {
Dimension rootSize = getVisibleRect().getSize();
Insets borderInsets = tooltip.getBorder().getBorderInsets(tooltip);
rootSize.width -= (borderInsets.left + borderInsets.right) * 2;
rootSize.height -= (borderInsets.top + borderInsets.bottom) * 2;
@NonNls StringBuilder tipBuilder = new StringBuilder();
final String markupText = node.getMarkupTooltipText();
if (markupText != null) {
tipBuilder.append(markupText);
}
if (!tipText.isEmpty()) {
final StringTokenizer tokenizer = new StringTokenizer(tipText, "\n ", true);
while (tokenizer.hasMoreElements()) {
final String each = tokenizer.nextElement();
if ("\n".equals(each)) {
tipBuilder.append("<br>");
}
else if (" ".equals(each)) {
tipBuilder.append("  ");
}
else {
tipBuilder.append(JDOMUtil.legalizeText(each));
}
}
}
tooltip.setTipText(UIUtil.toHtml(tipBuilder.toString(), 0));
}
tooltip.setBorder(null);
return tooltip;
}