Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.awt.image.BufferedImage;

import java.io.File;

import java.io.IOException;

import javax.imageio.ImageIO;

public class Main {
    public static final String FOLDER = File.separator + "programandoJava" + File.separator;

    private static void salvarNoDisco(BufferedImage fotoSalvar, String nomeFoto) throws IOException {
        File f = new File(FOLDER);

        if (!f.exists()) {
            f.mkdirs();
            f.setReadable(true);
            f.setWritable(true);
        }

        ImageIO.write(fotoSalvar, "png", new File(FOLDER + nomeFoto));
    }
}