I'm trying to set the icon image for a Jar file:
setIconImage(new ImageIcon(getClass().getResource("logo.png")).getImage());
When running in Mac OS X 10.7.4 I get the following error:
Jun 28 15:21:40 (my dhcp) java[73383] <Error>: CGContextGetCTM: invalid context 0x0
Jun 28 15:21:40 (my dhcp) java[73383] <Error>: CGContextSetBaseCTM: invalid context 0x0
Jun 28 15:21:40 (my dhcp) java[73383] <Error>: CGContextGetCTM: invalid context 0x0
Jun 28 15:21:40 (my dhcp) java[73383] <Error>: CGContextSetBaseCTM: invalid context 0x0
Jun 28 15:21:40 (my dhcp) java[73383] <Error>: CGContextGetCTM: invalid context 0x0
Jun 28 15:21:40 (my dhcp) java[73383] <Error>: CGContextSetBaseCTM: invalid context 0x0
getResource()
to load the image, ie:getClass().getClassLoader().getResource("logo.png")
– GriffyURL
returned bygetResource()
is not null. – Griffy