本文整理匯總了Java中org.jdesktop.swingx.tips.DefaultTip類的典型用法代碼示例。如果您正苦於以下問題:Java DefaultTip類的具體用法?Java DefaultTip怎麽用?Java DefaultTip使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DefaultTip類屬於org.jdesktop.swingx.tips包,在下文中一共展示了DefaultTip類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createTipOfTheDayModel
import org.jdesktop.swingx.tips.DefaultTip; //導入依賴的package包/類
protected TipOfTheDayModel createTipOfTheDayModel() {
// Create a tip model with some tips
DefaultTipOfTheDayModel tips = new DefaultTipOfTheDayModel();
// plain text
tips.add(new DefaultTip("Plain Text Tip", "This is the first tip " + "This is the first tip "
+ "This is the first tip " + "This is the first tip " + "This is the first tip "
+ "This is the first tip\n" + "This is the first tip " + "This is the first tip"));
// html text
tips.add(new DefaultTip("HTML Text Tip", "<html>This is an html <b>TIP</b><br><center>"
+ "<table border=\"1\">" + "<tr><td>1</td><td>entry 1</td></tr>"
+ "<tr><td>2</td><td>entry 2</td></tr>" + "<tr><td>3</td><td>entry 3</td></tr>"
+ "</table>"));
// a Component
tips.add(new DefaultTip("Component Tip", new JTree()));
// an Icon
tips.add(new DefaultTip("Icon Tip", new ImageIcon(BasicTipOfTheDayUI.class
.getResource("resources/TipOfTheDay24.gif"))));
return tips;
}
示例2: createTipOfTheDayModel
import org.jdesktop.swingx.tips.DefaultTip; //導入依賴的package包/類
private TipOfTheDayModel createTipOfTheDayModel() {
// Create a tip model with some tips
DefaultTipOfTheDayModel tips = new DefaultTipOfTheDayModel();
// plain text
tips
.add(new DefaultTip(
"tip1",
"This is the first tip " +
"This is the first tip " +
"This is the first tip " +
"This is the first tip " +
"This is the first tip " +
"This is the first tip\n" +
"This is the first tip " +
"This is the first tip"));
// html text
tips
.add(new DefaultTip(
"tip2",
"<html>This is an html <b>TIP</b><br><center>" +
"<table border=\"1\">" +
"<tr><td>1</td><td>entry 1</td></tr>" +
"<tr><td>2</td><td>entry 2</td></tr>" +
"<tr><td>3</td><td>entry 3</td></tr>" +
"</table>"));
// a Component
tips.add(new DefaultTip("tip3", new JTree()));
// an Icon
tips
.add(new DefaultTip(
"tip 4",
new ImageIcon(BasicTipOfTheDayUI.class.getResource("resources/TipOfTheDay24.gif"))));
return tips;
}
示例3: prepare
import org.jdesktop.swingx.tips.DefaultTip; //導入依賴的package包/類
@BeforeMethod
public void prepare() {
ArrayList<Tip> tips = new ArrayList<>();
for (int i = 0; i < TIPS_SIZE; i++) {
tips.add(new DefaultTip(Integer.toString(i), Integer.toString(i)));
}
TipOfTheDayModel model = new DefaultTipOfTheDayModel(tips);
tipsModel = new RandomTipOfTheDayModel(model);
}