Example usage for javax.swing AbstractButton setRolloverEnabled

List of usage examples for javax.swing AbstractButton setRolloverEnabled

Introduction

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

Prototype

@BeanProperty(visualUpdate = true, description = "Whether rollover effects should be enabled.")
public void setRolloverEnabled(boolean b) 

Source Link

Document

Sets the rolloverEnabled property, which must be true for rollover effects to occur.

Usage

From source file:Main.java

public static void main(String[] args) {
    AbstractButton jb = new JToggleButton("Press Me");
    jb.setRolloverEnabled(true);
    jb.setRolloverIcon(new MyIcon());

    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);//from   w ww . ja va2s .  c  o m
    f.pack();
    f.setVisible(true);
}