Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i import .icon files into a Swing app?

Status
Not open for further replies.

clax99

Programmer
Oct 29, 2001
23
0
0
US
does anyone know how im might import .icon files into my swing app. any help or code snippet would be nice, thanx
 
you can't. as far as I can remember (and bear in mind I was only using java2) - java only supports .gif and .jpg/.jpeg formats.

If you have a .icon file, you will first need to convert it to one of the formats mentioned above (by using image software such as GIMP - its free!!) and then you can bring the file into your swing app by creating a new ImageIcon and giving it the path.

e.g.

Icon myIcon = new ImageIcon(c:\yourpath);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top