Example usage for javax.swing AbstractButton setRolloverIcon

List of usage examples for javax.swing AbstractButton setRolloverIcon

Introduction

In this page you can find the example usage for javax.swing AbstractButton setRolloverIcon.

Prototype

@BeanProperty(visualUpdate = true, description = "The rollover icon for the button.")
public void setRolloverIcon(Icon rolloverIcon) 

Source Link

Document

Sets the rollover icon for the button.

Usage

From source file:Main.java

public static void main(String[] args) {
    AbstractButton jb = new JToggleButton("Press Me");
    jb.setRolloverEnabled(true);/*from   w  ww . ja  v a  2 s .  com*/
    jb.setRolloverIcon(new MyIcon());

    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);
    f.pack();
    f.setVisible(true);
}