to upload an image ImageIcon or a java applet using the following statement:
ImageIcon:
ImageIcon picture = new ImageIcon (getImage (getCodeBase (), "photo.jpg"));
ImageIcon image [] = new ImageIcon [10]; for (int i = 0; i image [i] = new ImageIcon (getImage (getCodeBase (), Integer.toString (i) + ". JPG"));}
Miage To load an applet is used following code: ImageIcon image [] = new Icon [10];
imgJava = getImage (j.getCodeBase (), "java.png");
<10;i++){
can also perform the above trick to upload groups of pictures.
for (int i = 0; i
image [i] = new getImage (j.getCodeBase (), "img" + Integer.toString (i) + " . png ");}
url
0 comments:
Post a Comment