hi guyz,
at the moment, in my application i am creating icons with the following code
Icon icon = new ImageIcon(getClass().getResource("icon.png"));
these images are kept in the classpath. How can i create them through spring IOC.
plz help.
hi guyz,
at the moment, in my application i am creating icons with the following code
Icon icon = new ImageIcon(getClass().getResource("icon.png"));
these images are kept in the classpath. How can i create them through spring IOC.
plz help.
You can do the following:
Code:<bean id="icon" class="javax.swing.ImageIcon"> <constructor-arg type="java.net.URL" value="classpath:/path/to/icon.png"/> </bean>
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf