[kepler-dev] Icons within Kepler

Michal Owsiak michal.owsiak at man.poznan.pl
Mon Oct 11 23:33:25 PDT 2010


Hello Christopher,

thanks for your suggestions.

> cd ~/src/kepler
> find . -name "*.gif"
> yields
> ./common/configs/ptolemy/configs/kepler/KeplerSmallIcon.gif
>
> I'm not sure, but I think
> getResource("ptolemy/configs/kepler/KeplerSmallIcon.gif")
> might do it.

This works fine, however I had to use Thread's class loader in order to 
load this icon instead of using Toolkit.

--- cut ---

URL rsrcUrl = 
Thread.currentThread().getContextClassLoader().getResource("ptolemy/configs/kepler/KeplerSmallIcon.gif");
Image img;
try {
  img = ImageIO.read(rsrcUrl);
  instance.setIconImage(img);
} catch (IOException e) {
  e.printStackTrace();
}

--- cut ---

Cheers

Michal

-- 
Michal Owsiak <michal.owsiak at man.poznan.pl>

Institute of Bioorganic Chemistry PAS
Poznan Supercomputing and Networking Center
Noskowskiego 12/14, 61-704 Poznan, POLAND

http://www.man.poznan.pl


More information about the Kepler-dev mailing list