Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Vector;

import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;

public class Main {

    public static void main(String[] args) throws Exception {
        File archivo = new File("c:/Java_Dev/run.bat");
        FileReader fr = new FileReader(archivo);
        BufferedReader br = new BufferedReader(fr);

        Vector<String> lines = new Vector<String>();

        String line;
        while ((line = br.readLine()) != null) {
            lines.add(line);
        }
        JOptionPane.showMessageDialog(null, new JScrollPane(new JList(lines)));
        fr.close();
    }
}