當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultTip類代碼示例

本文整理匯總了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;
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:25,代碼來源:TipOfTheDayDemo.java

示例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;
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:40,代碼來源:JXTipOfTheDayVisualCheck.java

示例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);
}
 
開發者ID:otros-systems,項目名稱:otroslogviewer,代碼行數:11,代碼來源:RandomTipOfTheDayModelTest.java


注:本文中的org.jdesktop.swingx.tips.DefaultTip類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。