Load and display all the images from a folder

前端 未结 3 1087
广开言路
广开言路 2020-12-08 03:20

I want to read all the images in a folder using Java.

When: I press a button in the Java application,
It should:

3条回答
  •  猫巷女王i
    2020-12-08 03:53

    step 1=first of all make a folder out of webapps 
    step2= write code to uploading a image in ur folder
    step3=write a code to display a image in ur respective jsp,html,jframe what u want
    
    this is folder=(images)
    reading image for folder'
    Image image = null;
            try {
                File sourceimage = new File("D:\\images\\slide4.jpg");
                  image = ImageIO.read(sourceimage);
    
            } catch (IOException e) {
                e.printStackTrace();
            }       
        }
    

提交回复
热议问题