import java.awt.Dimension;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
public class Main extends JFrame {
public static void main(String[] args) throws Exception {
Main frame = new Main();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(new Dimension(300, 200));
BufferedImage image = ImageIO.read(frame.getClass().getResource("/colors.jpg"));
frame.setIconImage(image);
frame.setVisible(true);
}
}
|