List of usage examples for javax.swing AbstractButton setRolloverEnabled
@BeanProperty(visualUpdate = true, description = "Whether rollover effects should be enabled.") public void setRolloverEnabled(boolean b)
rolloverEnabled
property, which must be true
for rollover effects to occur. 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); }