javax.swing.JButton.getIcon()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中javax.swing.JButton.getIcon()方法的一些代码示例,展示了JButton.getIcon()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.getIcon()方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:getIcon

JButton.getIcon介绍

暂无

代码示例

代码示例来源:origin: wiztools/rest-client

public ACTION_TYPE getActionType() {
  if(jb_request.getIcon() == icon_go){
    return ACTION_TYPE.GO;
  }
  else {
    return ACTION_TYPE.CANCEL;
  }
}

代码示例来源:origin: wiztools/rest-client

@Override
public boolean isRunning() {
  return jb_request.getIcon() == icon_stop;
}

代码示例来源:origin: wiztools/rest-client

@Override
public boolean isIdle() {
  return jb_request.getIcon() == icon_go;
}

代码示例来源:origin: stanfordnlp/CoreNLP

((ColorIcon) defaultColorButton.getIcon()).getColor(),
((ColorIcon) matchedButton.getIcon()).getColor(),
((ColorIcon) highlightButton.getIcon()).getColor(),
historySize,
maxMatchSize,

代码示例来源:origin: org.netbeans.api/org-openide-awt

bBack.setRolloverIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/back_hover.png", true)); //NOI18N
bBack.setDisabledIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/back_disabled.png", true)); //NOI18N
bBack.setSelectedIcon(bBack.getIcon());
bBack.setToolTipText(NbBundle.getMessage(HtmlBrowser.class, "CTL_Back")); //NOI18N
bForward.setRolloverIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/forward_hover.png", true)); //NOI18N
bForward.setDisabledIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/forward_disabled.png", true)); //NOI18N
bForward.setSelectedIcon(bForward.getIcon());
bForward.setToolTipText(NbBundle.getMessage(HtmlBrowser.class, "CTL_Forward")); //NOI18N
bReload.setRolloverIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/refresh_hover.png", true)); //NOI18N
bReload.setDisabledIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/refresh.png", true)); //NOI18N
bReload.setSelectedIcon(bReload.getIcon());
bReload.setToolTipText(NbBundle.getMessage(HtmlBrowser.class, "CTL_Reload")); //NOI18N
bReload.setFocusPainted(false);
bStop.setRolloverIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/stop_hover.png", true)); //NOI18N
bStop.setDisabledIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/stop.png", true)); //NOI18N
bStop.setSelectedIcon(bStop.getIcon());
bStop.setToolTipText(NbBundle.getMessage(HtmlBrowser.class, "CTL_Stop")); //NOI18N
bStop.setFocusPainted(false);

代码示例来源:origin: org.netbeans.api/org-openide-awt

private int computeVisibleButtons() {
  if (isShowing()) {
    int w = getOrientation() == HORIZONTAL ? overflowButton.getIcon().getIconWidth() + 4 : getWidth() - getInsets().left - getInsets().right;
    int h = getOrientation() == HORIZONTAL ? getHeight() - getInsets().top - getInsets().bottom : overflowButton.getIcon().getIconHeight() + 4;
    overflowButton.setMaximumSize(new Dimension(w, h));
    overflowButton.setMinimumSize(new Dimension(w, h));

代码示例来源:origin: com.google.code.validationframework/validationframework-swing

/**
 * @see AbstractComponentProperty#getPropertyValueFromComponent()
 */
@Override
protected Icon getPropertyValueFromComponent() {
  return component.getIcon();
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public boolean isAutoHide()
  {
   return _btnAutoHide.getIcon() == _iconAutohideOn;
  }
}

代码示例来源:origin: datacleaner/DataCleaner

@Override
public Icon getIcon() {
  return _button.getIcon();
}

代码示例来源:origin: org.nuiton.jrst/jrst

public void actionPerformed(ActionEvent e) {
    JButton b = (JButton) e.getSource();
    if (b.getIcon() == more)
      ajout();
    else
      supprimerXslLigne((JButton) e.getSource());
  }
});

代码示例来源:origin: stackoverflow.com

final JButton button = new JButton();
final ImageIcon icon = new ImageIcon(image);
button.setIcon(icon);

button.addActionListener(new ActionListener() {

  @Override
  public void actionPerformed(ActionEvent e) { 
     button.setIcon( button.getIcon() == null ? icon : null );
  }

});

代码示例来源:origin: stackoverflow.com

public void actionPerformed(ActionEvent e) {
  if(e.getSource() instanceof JButton){
    JButton pressedButton = (JButton) e.getSource();
    if(pressedButton.getIcon() == null){
      pressedButton.setIcon(new ImageIcon(getClass().getResource("/images/2.jpg")));
    } else {
      pressedButton.setIcon(null);
    }
  }
}

代码示例来源:origin: net.sourceforge.jadex/jadex-runtimetools-swing

/**
 *  Test if console is enabled.
 *  @return True, for enabled console.
 */
public boolean isConsoleEnabled()
{
  return onoff.getIcon()==icons.getIcon("off");
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = ICON_JSDOC)
@Override
public Icon getIcon() {
  return super.getIcon();
}

代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing

/**
 *  Test if console is enabled.
 *  @return True, for enabled console.
 */
public boolean isConsoleEnabled()
{
  return onoff.getIcon()==icons.getIcon("off");
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation

public RefreshAction() {
  putValue(Action.NAME, NbBundle.getMessage(ClassHierarchyPanel.class, "ClassHierarchyPanel.refreshButton.menuText")); //NOI18N
  putValue(Action.SMALL_ICON, refreshButton.getIcon());
  menuItem = new JMenuItem(this); 
  Mnemonics.setLocalizedText(menuItem, (String)getValue(Action.NAME));
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation

public RefreshAction() {
  putValue(Action.NAME, NbBundle.getMessage(IncludeHierarchyPanel.class, "IncludeHierarchyPanel.refreshButton.menuText")); //NOI18N
  putValue(Action.SMALL_ICON, refreshButton.getIcon());
  menuItem = new JMenuItem(this); 
  Mnemonics.setLocalizedText(menuItem, (String)getValue(Action.NAME));
}

代码示例来源:origin: stackoverflow.com

JButton button = new JButton(...);
button.setBorderPainted( false );
ImageIcon icon = (ImageIcon)button.getIcon();
Image image = icon.getImage();
Image scaled = image.getScaledImage(...);
button.setRolloverIcon( new ImageIcon( scaled ) );

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public String getText()
{
 if(BuPreferences.BU.getBooleanProperty("button.text",true)||
   (super.getIcon()==null)||
   !BuPreferences.BU.getBooleanProperty("button.icon",true))
  return super.getText();
 return null;
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public Icon getIcon()
{
 if(  BuPreferences.BU.getBooleanProperty("tool.icon",true)
   ||(super.getText()==null)
   ||!BuPreferences.BU.getBooleanProperty("tool.text",true))
  return super.getIcon();
 return null;
}

相关文章

JButton类方法