Card Games Egyptian Rat Screw

In java how do you read in a jpeg file to display in a applet?
Me and a Friend are making a card game and we need to read in picture files for each of the cards so we can display them in the applet but we dont known how to do that.
Also if you can think of anyother code or things we would need i would greatly appreciate that.
we are making slap jack or egyptian rat screw.
its going to be mulitplayer.
we are working with a card class that handels all the basic data on a card.
After importing the following:
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.io.File;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
code this:
public static void main(String args[])
{
String imageName = JOptionPane.showInputDialog(“Enter the file name”);
try
{
BufferedImage image = ImageIO.read(new File(imageName));
Icon icon = new ImageIcon(image);
JLabel label = new JLabel(icon);
JOptionPane.showMessageDialog(null, label, imageName, JOptionPane.PLAIN_MESSAGE);
}
catch(IOException e)
{
JOptionPane.showMessageDialog(null, e.toString());
}
}
Epic Egyptian Rat Screw!
|
|
Hoyle Card Games. For the gameboy color $1.95 |
|
|
TURN OF THE CENTURY VINTAGE HOYLE’S BOOK OF GAMES CARDS RULES CHESS CHECKER POOL $16.00 |
|
|
Hoyle’s Encyclopedia of Card Games; Rules of All the Basic Games and Popular… $9.53 |
|
|
Used Hoyle 2005 edition CARD GAMES, in box $0.99 |
|
|
“Let’s Play Football” Card Game – 1976 A Hoyle Card Game Product $8.99 |
|
|
Hoyle’s Card Games by Lawrence H Dawson $4.98 |
|
|
4 HOYLE CARD & BOARD COMPUTER GAMES LOT-ORIGINAL & BRAND NEW-SEALED – VERY RARE $9.99 |
|
|
Lot HOYLE CARD GAMES 2008 + SCRABBLE CHAMPION $12.16 |
|
|
Lot HOYLE CARD GAMES 2008 + MONOPOLY HERE & NOW Bundle $12.21 |
|
|
Lot HOYLE CARD GAMES +Milton Bradley BOARD GAMES Bundle $9.79 |