Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.File;

import javax.swing.JFileChooser;

public class Main {
    public static void main(String[] argv) {
        String filename = File.separator + "tmp";
        JFileChooser fc = new JFileChooser(new File(filename));

        // Show open dialog
        fc.showOpenDialog(null);
        File selFile = fc.getSelectedFile();

        // Show save dialog
        fc.showSaveDialog(null);
        selFile = fc.getSelectedFile();

    }
}