SetIconImage « Icon Image « Java Swing Q&A





1. SetIconImage Question    coderanch.com

I have want to set the icon for the application that I am building. Followed everything that I need to do ok. The problem that I am having is that the applicaiton hangs when I try to use a .gif file and will display the icon ok when I use a .jpg file. I thought that you could use a .gif ...

2. Need help with setIconImage    coderanch.com

Originally posted by Michael Dunn: frame.setIconImage(new ImageIcon("test.gif").getImage()); put your .gif file into the same folder as your java file, and it should work from there. if it does, then you can try subfolders for your .gifs, and/or testing with .ico files I've tried those suggestions, but still not working. So the problem must be that I'm not extending JFrame. But when ...

3. about setIconImage()    coderanch.com

import java.io.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.text.*; import javax.swing.event.*; class FrameIconExample extends JFrame { privateJLabellabel1;//4 the label private ImageIcon imgeIcon1 = new ImageIcon();// 4 public FrameIconExample() { //setting for the title bar setTitle( "tyring........" ); setSize( 600, 450 ); setBackground( Color.cyan ); JPanel topPanel= new JPanel(); topPanel.setLayout(null ); getContentPane().add( topPanel ); BufferedImage imageIcon1 = null; try { imageIcon1 ...