Description: View the picture in a folder, displayed in Web pages. Applet: package tom.jiafei import java.io.* class FileName implements FilenameFilter {public boolean accept (File dir, String name) {boolean boo = false if (name.endsWith (" . Jpg" ) | | name . endsWith (" . JPG" )) boo = true return boo }} public class Play {int imageNumber = 0, max String pictureName [], playImage public Play () {File dir = new File (" D:/myjsp/image " ) pictureName = dir.list (new FileName ()) max = pictureName.length } public void setImageNumber (int n) {if (n < 0) n = max-1 if (n = = max) n = 0 imageNumber = n } public int getImageNumber () {return imageNumber } public String getPlayImage () {playImage = new String (" <image src=image/"+pictureName[imageNumber]+" "+
" width=900 height=800></image> " ) Return playImage
To Search:
File list (Check if you may need any files):
浏览图片代码\showPic.jsp
............\WEB-INF\classes\Play.java
............\.......\.......\tom\jiafei\FileName.class
............\.......\.......\...\......\Play.class
............\.......\.......\...\jiafei
............\.......\.......\tom
............\.......\classes
............\WEB-INF
浏览图片代码