Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.FileInputStream;

import javax.swing.JOptionPane;
import javax.swing.ProgressMonitorInputStream;

public class Main {

    public static void main(String args[]) {
        ProgressMonitorInputStream monitor;
        try {
            monitor = new ProgressMonitorInputStream(null, "Loading ", new FileInputStream("yourFile.dat"));
            while (monitor.available() > 0) {
                byte[] data = new byte[38];
                monitor.read(data);
                System.out.write(data);
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Unable to find file: yourFile.dat", "Error",
                    JOptionPane.ERROR_MESSAGE);
        }
    }
}