Changing Java Icon

Status
Not open for further replies.

Adam Cruge1

Broken In
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....
 
OP
A

Adam Cruge1

Broken In
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);
}
}
 
Status
Not open for further replies.
Top Bottom