This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
HELP!!!! how do i get image by extending Canvas object
Richard Teston
Ranch Hand
Joined: Feb 12, 2002
Posts: 89
posted
0
help... i have this code i've extended the canvas object, basically i'm coding my own button by using canvas but how do i get image from a file
The Code is the Programmer
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi Richard, How about: Image im = Toolkit.getDefaultToolkit().getImage( "C:\\TEMP\file.gif" ); Regards, Manfred.
Roy Ben Ami
Ranch Hand
Joined: Jan 13, 2002
Posts: 732
posted
0
also, since you are using canvas i guess you are using AWT and not swing. if u ecide to switch to swing then u can use the class called ImageIcon. only needs a filename in its constructor. ImageIcon x=new ImageIcon("file name");
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: HELP!!!! how do i get image by extending Canvas object