
October 26th, 2012, 09:07 PM
|
|
Contributing User
|
|
Join Date: Oct 2011
Posts: 43
Time spent in forums: 10 h 31 m 45 sec
Reputation Power: 2
|
|
|
Drawing an image from URL?
Im new to drawing graphicsIs this method working or should I add a paint method? Also, it gives an error : change ghost to ImageIcon, but then it changes the drawImage to drawLine.
Code:
URL url = new URL("http://1.bp.blogspot.com/_y3qWcWEV3Gc/TL-Ubk3mx0I/AAAAAAAAAJ0/UxcN2eXwCa4/s200/nes_ms_pac_man_ghost-copy.jpeg");
Image ghost = new ImageIcon(url);
graphics.drawImage(ghost, x, y, (ImageObserver) this);
|