• Post Reply Bookmark Topic Watch Topic
  • New Topic

set .ico icon on JButton  RSS feed

 
sac kul
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to set Image icon of *.ico type on JButton, I try to
set by following code,
try{
imgIcon = new ImageIcon(new URL(serverPath);
JButton btn = new JButton(imgIcon );
} catch (MalformedURLException e) {
e.printStackTrace();
}
But it doesn't work while using jdk1.2.2!
Thanks in advance
sachin
[ May 20, 2005: Message edited by: sac kul ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.ico is not supported. I believe there are plans for .ico support in Mustang (1.6) but as of right now, no such luck. Frankly, I am not sure what image types are supported on 1.2 but you best bet would be a GIF or BMP.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!