Java Swing Tutorial - Java AbstractButton .getRolloverSelectedIcon ()








Syntax

AbstractButton.getRolloverSelectedIcon() has the following syntax.

public Icon getRolloverSelectedIcon()

Example

In the following code shows how to use AbstractButton.getRolloverSelectedIcon() method.

import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JFrame;
/*  w  ww . j  av  a 2  s .c om*/
public class Main {
  public static void main(String[] args) {
    AbstractButton jb = new JButton("Press Me");
    System.out.println(jb.getRolloverSelectedIcon());
    
    
    
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);
    f.pack();
    f.setVisible(true);
  }
}