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


Java JButton.setDisabledIcon方法代码示例

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


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

示例1: getToolbarPresenter

import javax.swing.JButton; //导入方法依赖的package包/类
public static Component getToolbarPresenter(Action action) {
    JButton button = new JButton(action);
    button.setBorderPainted(false);
    button.setOpaque(false);
    button.setText(null);
    button.putClientProperty("hideActionText", Boolean.TRUE); // NOI18N
    Object icon = action.getValue(Action.SMALL_ICON);
    if (icon == null) {
        icon = ImageUtilities.loadImageIcon("org/netbeans/modules/dlight/terminal/action/local_term.png", false);// NOI18N
    }
    if (!(icon instanceof Icon)) {
        throw new IllegalStateException("No icon provided for " + action); // NOI18N
    }
    button.setDisabledIcon(ImageUtilities.createDisabledIcon((Icon) icon));
    return button;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:TerminalSupportImpl.java

示例2: customizePanel

import javax.swing.JButton; //导入方法依赖的package包/类
public void customizePanel(JPanel valuePanel, Container buttonsPanel) {
     valuePanel.setLayout(new BorderLayout());
     valuePanel.add(jComboBoxColumns);
     jComboBoxColumns.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
             setJavelinZoneFromProperty();
         }
     });
     
     addButton = new JButton();
     addButton.setFocusPainted(false);
     addButton.setEnabled(false);
     addButton.setPreferredSize(new Dimension(24, 24));
     addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/twinsoft/convertigo/eclipse/property_editors/images/table_editor/new_line.png")));
     addButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/com/twinsoft/convertigo/eclipse/property_editors/images/table_editor/new_line.d.png")));
     addButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent actionEvent) {
             addButtonActionPerformed();
         }
     });
     buttonsPanel.add(addButton);
     
     if (javelin != null) {
javelin.addZoneListener(this);
     }
 }
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:27,代码来源:ColumnEditor.java

示例3: SplashScreen

import javax.swing.JButton; //导入方法依赖的package包/类
public SplashScreen(Image image) {
	this.icon = new ImageIcon(image);

	Container container = getContentPane();
	container.setLayout(null);

	BufferedImage alphaImage = new BufferedImage(this.icon.getIconWidth(), this.icon.getIconHeight(), 2);
	Graphics2D g = alphaImage.createGraphics();
	g.drawImage(image, 0, 0, this.icon.getIconWidth(), this.icon.getIconHeight(), null);
	g.dispose();

	JButton background = new JButton(new ImageIcon(alphaImage));
	background.setBounds(0, 0, this.icon.getIconWidth(), this.icon.getIconHeight());
	background.setRolloverEnabled(true);
	background.setRolloverIcon(background.getIcon());
	background.setSelectedIcon(background.getIcon());
	background.setDisabledIcon(background.getIcon());
	background.setPressedIcon(background.getIcon());
	background.setFocusable(false);
	background.setContentAreaFilled(false);
	background.setBorderPainted(false);
	background.setOpaque(false);
	container.add(background);

	setSize(this.icon.getIconWidth(), this.icon.getIconHeight() + 20);
	try {
		setBackground(new Color(0, 0, 0, 0));
	} catch (UnsupportedOperationException e) {
		setBackground(new Color(0, 0, 0));
	}
	setLocationRelativeTo(null);
}
 
开发者ID:DivergenceBot,项目名称:Bootstrapper,代码行数:33,代码来源:SplashScreen.java

示例4: addUnitTypes

import javax.swing.JButton; //导入方法依赖的package包/类
private void addUnitTypes() {
    int row = 1;

    JButton allColonistsButton = createUnitNameButton(Messages.message("report.labour.allColonists"), labourData.getSummary());
    reportPanel.add(allColonistsButton, "cell " + COLONY_COLUMN + " " + row + " 1 " + labourData.getSummary().getUnitSummaryRowCount());

    row = addLocationData(labourData.getSummary().getTotal(), null, row);

    for (UnitType unitType : LabourData.getLabourTypes(getMyPlayer())) {
        LabourData.UnitData unitData = labourData.getUnitData(unitType);

        JButton unitButton = createUnitNameButton(unitData.getUnitName(), unitData);
        int rows = unitData.getUnitSummaryRowCount();
        reportPanel.add(unitButton, "cell " + COLONY_COLUMN + " " + row + " 1 " + rows);

        if (unitData.hasDetails()) {
            row = addLocationData(unitData.getTotal(), null, row);
        } else {
            unitButton.setEnabled(false);
            unitButton.setDisabledIcon(unitButton.getIcon());
            unitButton.setForeground(Color.GRAY);

            reportPanel.add(createEmptyLabel(), "cell " + UNIT_TYPE_COLUMN + " " + row + " " + (COLUMNS - 1) + " 1");
            row++;
        }
    }
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:28,代码来源:CompactLabourReport.java

示例5: createButton

import javax.swing.JButton; //导入方法依赖的package包/类
private JButton createButton(int icon) {
	JButton button = new JButton( Icons.getIcon(icon,false));
	button.setPressedIcon( Icons.getIcon(icon, true) );
	button.setDisabledIcon( Icons.getDisabledIcon( icon, false ));
	button.setBorder( BorderFactory.createLineBorder(Color.black));
	button.setMargin(new Insets(1,0,1,0));
	return button;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:9,代码来源:LayerManager.java


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