Results 1 to 8 of 8
- 10-26-2011, 06:27 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 15
- Rep Power
- 0
- 10-26-2011, 06:47 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,604
- Blog Entries
- 7
- Rep Power
- 17
Re: Help me!
Have a look at the ImageIO class; it has methods that can read image files and create a BufferedImage out of them. You can also try to use the ImageIcon class ...
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-26-2011, 06:52 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 15
- Rep Power
- 0
Re: Help me!
I have try this coding, but i can't open the image. I don't know why.
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
File file = new File("sign.jpg");
BufferedImage img;
img = ImageIO.read(file);
- 10-26-2011, 06:58 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,604
- Blog Entries
- 7
- Rep Power
- 17
Re: Help me!
Maybe your program runs in a directory different from where your sign.jpg file is stored; try to use an absolute path name, e.g. "c:/usr/foo/sign.jpg". If you want to see where your program is running, add the following line:
kind regards,Java Code:System.out.println(System.getProperty("user.dir"));
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-26-2011, 07:09 AM #5
Member
- Join Date
- Oct 2011
- Posts
- 15
- Rep Power
- 0
- 10-26-2011, 07:11 AM #6
Re: Help me!
Where is your class?
Where is your methods?
- 10-26-2011, 07:15 AM #7
Member
- Join Date
- Oct 2011
- Posts
- 15
- Rep Power
- 0
Re: Help me!
class? method? I'm sorry but I have zero knowledge about java.
- 10-26-2011, 07:35 AM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,604
- Blog Entries
- 7
- Rep Power
- 17
Re: Help me!
When people rob a bank they get a penalty; when banks rob people they get a bonus.


1Likes
LinkBack URL
About LinkBacks
Reply With Quote



Bookmarks