当前位置: 首页>>代码示例>>Java>>正文


Java JButton.getRolloverIcon方法代码示例

本文整理汇总了Java中javax.swing.JButton.getRolloverIcon方法的典型用法代码示例。如果您正苦于以下问题:Java JButton.getRolloverIcon方法的具体用法?Java JButton.getRolloverIcon怎么用?Java JButton.getRolloverIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JButton的用法示例。


在下文中一共展示了JButton.getRolloverIcon方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testIconsSystemAction

import javax.swing.JButton; //导入方法依赖的package包/类
/**
 * Test whether pressed, rollover and disabled icons
 * work for SystemAction.
 */
public void testIconsSystemAction() throws Exception {
    Action saInstance = SystemAction.get(TestSystemAction.class);
    
    JButton jb = new JButton();
    Actions.connect(jb, saInstance);
    
    Icon icon = jb.getIcon();
    assertNotNull(icon);
    checkIfLoadedCorrectIcon(icon, jb, 0, "Enabled icon");
    
    Icon rolloverIcon = jb.getRolloverIcon();
    assertNotNull(rolloverIcon);
    checkIfLoadedCorrectIcon(rolloverIcon, jb, 1, "Rollover icon");
    
    Icon pressedIcon = jb.getPressedIcon();
    assertNotNull(pressedIcon);
    checkIfLoadedCorrectIcon(pressedIcon, jb, 2, "Pressed icon");
    
    Icon disabledIcon = jb.getDisabledIcon();
    assertNotNull(disabledIcon);
    checkIfLoadedCorrectIcon(disabledIcon, jb, 3, "Disabled icon");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ActionsTest.java

示例2: testIconsSystemAction24

import javax.swing.JButton; //导入方法依赖的package包/类
/**
 * Test whether pressed, rollover and disabled 24x24 icons
 * work for SystemAction.
 */
public void testIconsSystemAction24() throws Exception {
    Action saInstance = SystemAction.get(TestSystemAction.class);
    
    JButton jb = new JButton();
    jb.putClientProperty("PreferredIconSize",new Integer(24));
    Actions.connect(jb, saInstance);
    
    Icon icon = jb.getIcon();
    assertNotNull(icon);
    checkIfLoadedCorrectIcon(icon, jb, 4, "Enabled icon");
    
    Icon rolloverIcon = jb.getRolloverIcon();
    assertNotNull(rolloverIcon);
    checkIfLoadedCorrectIcon(rolloverIcon, jb, 5, "Rollover icon");
    
    Icon pressedIcon = jb.getPressedIcon();
    assertNotNull(pressedIcon);
    checkIfLoadedCorrectIcon(pressedIcon, jb, 6, "Pressed icon");
    
    Icon disabledIcon = jb.getDisabledIcon();
    assertNotNull(disabledIcon);
    checkIfLoadedCorrectIcon(disabledIcon, jb, 7, "Disabled icon");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:ActionsTest.java

示例3: testIconsAction

import javax.swing.JButton; //导入方法依赖的package包/类
/**
 * Test whether pressed, rollover and disabled icons
 * work for javax.swing.Action.
 */
public void testIconsAction() throws Exception {
    JButton jb = new JButton();
    Actions.connect(jb, new TestAction());

    Icon icon = jb.getIcon();
    assertNotNull(icon);
    checkIfLoadedCorrectIcon(icon, jb, 0, "Enabled icon");

    Icon rolloverIcon = jb.getRolloverIcon();
    assertNotNull(rolloverIcon);
    checkIfLoadedCorrectIcon(rolloverIcon, jb, 1, "Rollover icon");

    Icon pressedIcon = jb.getPressedIcon();
    assertNotNull(pressedIcon);
    checkIfLoadedCorrectIcon(pressedIcon, jb, 2, "Pressed icon");

    Icon disabledIcon = jb.getDisabledIcon();
    assertNotNull(disabledIcon);
    checkIfLoadedCorrectIcon(disabledIcon, jb, 3, "Disabled icon");
    
    Icon selectedIcon = jb.getSelectedIcon();
    assertNotNull(selectedIcon);
    checkIfLoadedCorrectIcon(selectedIcon, jb, 8, "Selected icon");
    
    Icon rolloverSelectedIcon = jb.getRolloverSelectedIcon();
    assertNotNull(rolloverSelectedIcon);
    checkIfLoadedCorrectIcon(rolloverSelectedIcon, jb, 9, "RolloverSelected icon");

    // no pressedSelected
    
    Icon disabledSelectedIcon = jb.getDisabledSelectedIcon();
    assertNotNull(disabledSelectedIcon);
    checkIfLoadedCorrectIcon(disabledSelectedIcon, jb, 11, "DisabledSelected icon");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:ActionsTest.java

示例4: testIconsAction24

import javax.swing.JButton; //导入方法依赖的package包/类
/**
 * Test whether pressed, rollover and disabled 24x24 icons
 * work for javax.swing.Action.
 */
public void testIconsAction24() throws Exception {
    JButton jb = new JButton();
    jb.putClientProperty("PreferredIconSize",new Integer(24));
    Actions.connect(jb, new TestAction());
    
    Icon icon = jb.getIcon();
    assertNotNull(icon);
    checkIfLoadedCorrectIcon(icon, jb, 4, "Enabled icon24");
    
    Icon rolloverIcon = jb.getRolloverIcon();
    assertNotNull(rolloverIcon);
    checkIfLoadedCorrectIcon(rolloverIcon, jb, 5, "Rollover icon24");
    
    Icon pressedIcon = jb.getPressedIcon();
    assertNotNull(pressedIcon);
    checkIfLoadedCorrectIcon(pressedIcon, jb, 6, "Pressed icon24");
    
    Icon disabledIcon = jb.getDisabledIcon();
    assertNotNull(disabledIcon);
    checkIfLoadedCorrectIcon(disabledIcon, jb, 7, "Disabled icon24");

    Icon selectedIcon = jb.getSelectedIcon();
    assertNotNull(selectedIcon);
    checkIfLoadedCorrectIcon(selectedIcon, jb, 12, "Selected icon24");

    Icon rolloverSelectedIcon = jb.getRolloverSelectedIcon();
    assertNotNull(rolloverSelectedIcon);
    checkIfLoadedCorrectIcon(rolloverSelectedIcon, jb, 13, "RolloverSelected icon24");

    // no pressedSelected

    Icon disabledSelectedIcon = jb.getDisabledSelectedIcon();
    assertNotNull(disabledSelectedIcon);
    checkIfLoadedCorrectIcon(disabledSelectedIcon, jb, 15, "DisabledSelected icon24");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:ActionsTest.java


注:本文中的javax.swing.JButton.getRolloverIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。