Voilą:
	Codice:
	/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Test {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            
            public void run() {
                Test.start();
            }
        });
    }
    private static void start() {
        final Image image = new ImageIcon(Test.class.getResource("/icon.png")).getImage();;
        final Icon resizableIcon = new Icon() {
            @Override
            public void paintIcon(Component c, Graphics g, int x, int y) {
                g.drawImage(image, 0, 0, c.getWidth(), c.getHeight(), null);
            }
            @Override
            public int getIconWidth() {
                return image.getWidth(null);
            }
            @Override
            public int getIconHeight() {
                return image.getHeight(null);
            }
        };
        JFrame win = new JFrame("Hello");
        win.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        JButton button = new JButton("Press me!");
        button.setHorizontalTextPosition(JButton.CENTER);
        button.setIcon(resizableIcon);
        win.add(button);
        win.pack();
        win.setVisible(true);
    }
}