DIGIT-ARC read-only archive · snapshot: July 23, 2026

Changing Java Icon

3 posts · originally from https://geek.digit.in/community/threads/changing-java-icon.112486/

A
Adam Cruge1 Original post #1
Apr 8, 2009 at 4:25 PM
I want to change the coffee cup java icon from Frame....I want my own icon over there....
How can I do that?
Please help me....
Write a simple Frame programming in java to demonstrate it....
A
Apr 9, 2009 at 10:59 PM
Oooooooo after a lots of googling i got something...but having no help....
Can u anyone please make the following code correct ??



import javax.swing.JFrame;
import javax.swing.ImageIcon;
import java.awt.Image;
public class Test
{
public static void main(String[] args) throws Exception
{
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("D:/icon")));
frame.pack();
frame.setVisible(true);
}
}
F
FilledVoid #3
May 4, 2009 at 6:29 AM
Spam Reported.