Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - import java.io.*
Search - import java.io.* - List
查看某个文件夹中的图片,显示在网页中。程序片: 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 } }-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 }}
Date : 2025-12-28 Size : 3kb User : 方涛
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.