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

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

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

JButton.setRolloverIcon介绍

暂无

代码示例

代码示例来源:origin: skylot/jadx

button.setRolloverIcon(ICON_CLOSE);
button.setRolloverEnabled(true);
button.setOpaque(false);

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

private void updateRollover( Icon rollover, Icon rolloverSelected ) {
  super.setRolloverIcon( rollover );
  super.setRolloverSelectedIcon( rolloverSelected );
}

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

BufferedImage startButton = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup.png"));
BufferedImage startButtonHover = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_hover.png"));
BufferedImage startButtonActive = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_active.png"));

JButton startBackupButton = new JButton(new ImageIcon(startButton));
startBackupButton.setRolloverIcon(new ImageIcon(startButtonHover));
startBackupButton.setPressedIcon(new ImageIcon(startButtonActive));
startBackupButton.setBorder(BorderFactory.createEmptyBorder());
startBackupButton.setContentAreaFilled(false);
startBackupButton.setFocusable(false);

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

@Override
public void setRolloverIcon(Icon icon) {
  Icon arrow = updateIcons( icon, ICON_ROLLOVER );
  arrowIcons.remove( ICON_ROLLOVER_LINE );
  arrowIcons.remove( ICON_ROLLOVER_SELECTED_LINE );
  super.setRolloverIcon( hasPopupMenu() ? arrow : icon );
}

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

JButton button = new JButton();
button.setBorderPainted(false);
button.setBorder(null);
//button.setFocusable(false);
button.setMargin(new Insets(0, 0, 0, 0));
button.setContentAreaFilled(false);
button.setIcon(myIcon1);
button.setRolloverIcon(myIcon2);
button.setPressedIcon(myIcon3);
button.setDisabledIcon(myIcon4);

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

/**
 * Creates a big 'close' JButton with close icon, rollover icon and pressed icon according to Look and Feel
 *
 * @return JButton with close icons.
 */
public static JButton createBigCloseButton() {
  JButton closeButton = new JButton();
  int size = 19;
  closeButton.setPreferredSize(new Dimension(size, size));
  closeButton.setContentAreaFilled(false);
  closeButton.setFocusable(false);
  closeButton.setBorder(BorderFactory.createEmptyBorder());
  closeButton.setBorderPainted(false);
  closeButton.setRolloverEnabled(true);
  closeButton.setIcon(ImageUtilities.image2Icon(getBigCloseTabImage()));
  closeButton.setRolloverIcon(ImageUtilities.image2Icon(getBigCloseTabRolloverImage()));
  closeButton.setPressedIcon(ImageUtilities.image2Icon(getBigCloseTabPressedImage()));
  return closeButton;
}

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

/**
 * Creates a small 'close' JButton with close icon, rollover icon and pressed icon according to Look and Feel
 *
 * @return JButton with close icons.
 */
public static JButton createCloseButton() {
  JButton closeButton = new JButton();
  int size = 16;
  closeButton.setPreferredSize(new Dimension(size, size));
  closeButton.setContentAreaFilled(false);
  closeButton.setFocusable(false);
  closeButton.setBorder(BorderFactory.createEmptyBorder());
  closeButton.setBorderPainted(false);
  closeButton.setRolloverEnabled(true);
  closeButton.setIcon(ImageUtilities.image2Icon(getCloseTabImage()));
  closeButton.setRolloverIcon(ImageUtilities.image2Icon(getCloseTabRolloverImage()));
  closeButton.setPressedIcon(ImageUtilities.image2Icon(getCloseTabPressedImage()));
  return closeButton;
}

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

bBack.setContentAreaFilled(false);
bBack.setIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/back_normal.png", true)); //NOI18N
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());
bForward.setContentAreaFilled(false);
bForward.setIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/forward_normal.png", true)); //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());
bReload.setContentAreaFilled(false);
bReload.setIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/refresh.png", true)); //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());
bStop.setContentAreaFilled(false);
bStop.setIcon(ImageUtilities.loadImageIcon("org/openide/resources/html/stop.png", true)); //NOI18N
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());

代码示例来源:origin: senbox-org/snap-desktop

private void updateViewButton(final ImageIcon icon) {
    button.setIcon(icon);
    button.setRolloverIcon(icon);
  }
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** installs the icons and tooltip suitable for a maximize button */
protected void configureMaximizeButton(JButton btn) {
  btn.setIcon(maximizeIcon);
  btn.setRolloverIcon(maximizeIconRollover);
  btn.setPressedIcon(maximizeIconPressed);
  btn.setRolloverSelectedIcon(maximizeIconRollover);
  btn.setToolTipText(MAXIMIZE_TEXT);
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** installs the icons and tooltip suitable for a restore button.
 */
protected void configureRestoreButton(JButton btn) {
  btn.setIcon(restoreIcon);
  btn.setRolloverIcon(restoreIconRollover);
  btn.setPressedIcon(restoreIconPressed);
  btn.setRolloverSelectedIcon(restoreIconRollover);
  btn.setToolTipText(RESTORE_TEXT);
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** installs the icons and tooltip suitable for a float button */
protected void configureFloatButton(JButton btn) {
  btn.setIcon(floatIcon);
  btn.setRolloverIcon(floatIconRollover);
  btn.setPressedIcon(floatIconPressed);
  btn.setRolloverSelectedIcon(floatIconRollover);
  btn.setToolTipText(FLOAT_TEXT);
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** installs the icons and tooltip suitable for a close button */
protected void configureCloseButton(JButton btn) {
  btn.setIcon(closeIcon);
  btn.setRolloverIcon(closeIconRollover);
  btn.setPressedIcon(closeIconPressed);
  btn.setRolloverSelectedIcon(closeIconRollover);
  btn.setToolTipText(CLOSE_TEXT);
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** installs the icons and tooltip suitable for a dock button */
protected void configureDockButton(JButton btn) {
  btn.setIcon(dockIcon);
  btn.setRolloverIcon(dockIconRollover);
  btn.setPressedIcon(dockIconPressed);
  btn.setRolloverSelectedIcon(dockIconRollover);
  btn.setToolTipText(RESTORE_TEXT);
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** installs the icons and tooltip suitable for an attach button */
protected void configureAttachButton(JButton btn) {
  btn.setIcon(attachIcon);
  btn.setRolloverIcon(attachIconRollover);
  btn.setPressedIcon(attachIconPressed);
  btn.setRolloverSelectedIcon(attachIconRollover);
  btn.setToolTipText(ATTACH_TEXT);
}

代码示例来源:origin: org.gephi/ui-components

@Override
public void setRolloverIcon(Icon icon) {
  Icon arrow = updateIcons(icon, ICON_ROLLOVER);
  arrowIcons.remove(ICON_ROLLOVER_LINE);
  arrowIcons.remove(ICON_ROLLOVER_SELECTED_LINE);
  super.setRolloverIcon(hasPopupMenu() ? arrow : icon);
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** installs the icons and tooltip suitable for a hide button */
protected void configureHideButton(JButton btn) {
  btn.setIcon(hideIcon);
  btn.setRolloverIcon(hideIconRollover);
  btn.setPressedIcon(hideIconPressed);
  btn.setRolloverSelectedIcon(hideIconRollover);
  btn.setToolTipText(ICONIFY_TEXT);
}

代码示例来源:origin: org.rwshop/org.rwshop.swing.common

/**
 *
 * @param icon
 * @param hover
 * @param select
 */
public void setCloseIcons(Icon icon, Icon hover, Icon select){
  myCloseButton.setIcon(icon);
  myCloseButton.setRolloverIcon(hover);
  myCloseButton.setSelectedIcon(select);
  myCloseButton.setRolloverEnabled(hover == null && select == null);
}

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

JButton button = new JButton();
button.setBorderPainted(false);
button.setBorder(null);
button.setMargin(new Insets(0, 0, 0, 0));
button.setContentAreaFilled(false);
button.setIcon(myIcon1);
button.setRolloverIcon(myIcon2);
button.setPressedIcon(myIcon3);
button.setDisabledIcon(myIcon4);

代码示例来源: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 ) );

相关文章

JButton类方法