Java 使用Jfilechooser编辑仍处于打开状态的文件副本,并在行尾追加sum

Java 使用Jfilechooser编辑仍处于打开状态的文件副本,并在行尾追加sum,java,file-io,filereader,jfilechooser,file-writing,Java,File Io,Filereader,Jfilechooser,File Writing,任务: 我需要使用GUI界面打开一个文件,对每一行进行求和,并将每一行的内容后跟一系列空格以及每一行的求和输出到一个新文件中。如果愿意,新文件必须标记为Previousfilename\u out.txt,也称为*\u out.txt 我现在的位置: 我有一个GUI可以工作并复制文件 编辑和汇总文件中的行似乎是一个问题 我目前只有GUI工作的程序不识别新行字符,并在新行上显示所有求和的整数,例如 输入: 输出: 由于不需要“,”分隔testfile.txt中的整数,我删除了分隔符,在点击“复制”

任务:

我需要使用GUI界面打开一个文件,对每一行进行求和,并将每一行的内容后跟一系列空格以及每一行的求和输出到一个新文件中。如果愿意,新文件必须标记为Previousfilename\u out.txt,也称为*\u out.txt

我现在的位置:

我有一个GUI可以工作并复制文件

编辑和汇总文件中的行似乎是一个问题

我目前只有GUI工作的程序不识别新行字符,并在新行上显示所有求和的整数,例如

输入:

输出:

由于不需要“,”分隔testfile.txt中的整数,我删除了分隔符,在点击“复制”后,整个程序失败,出现错误:

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "1 2 3 4 5"
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at fileSumCompute.computeF(fileSumCompute.java:210)
        at fileSumCompute$myHandler.actionPerformed(fileSumCompute.java:105)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
即使Jfilechooser正在使用副本,如何编辑副本?我怎样才能让它识别新行字符,但仍然打印出最后一个和EOFhad的问题,与以前的版本,错误有

旧代码:

新代码:

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.nio.file.*;
import java.util.*;

public class fileSumCompute extends JFrame{
//my first gui
private JFileChooser fc;
private JButton copyButton;
private JButton chooseFileButton;
private JButton destinationButton;
private File workingDirectory;
private JLabel sourceLabel;
private JLabel destinationLabel;
private JTextField sourceText;
private JTextField sourceFileText;
private JTextField destinationText;

    public static void main(String [] args)  
    {
        fileSumCompute cpy1 = new fileSumCompute();
        cpy1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        cpy1.setSize(600, 150);
        cpy1.setVisible(true);
    }
    //my first time creating and opening files without direct command line input. 

    public fileSumCompute() {  @Override
        //peiced together a couple JfileChooser examples and customized... I cant seem to get it to work without the other path selection and preprograming it into the same directory as source file. 
        //It works though.
        super("Compute sum of row. New file = \" *_out.txt\" ");
        setLayout(new GridLayout(3, 3, 5, 5));
        fc = new JFileChooser();

        //Open dialog box to make easier to find files
        workingDirectory = new File(System.getProperty("user.dir"));
        fc.setCurrentDirectory(workingDirectory);

     //create labels and buttons
        chooseFileButton = new JButton("CHOOSE SOURCE FILE");
        destinationButton = new JButton("DESTINATION FOLDER");
        copyButton = new JButton("COMPUTE & SAVE FILE");      //copies file so origonal is preserved
        sourceLabel = new JLabel("SOURCE: ");
        sourceText = new JTextField(10);
        sourceText.setEditable(false);
        destinationLabel = new JLabel("DESTINATION: ");
        destinationText = new JTextField(10);
        destinationText.setEditable(false);

        //JFrame tools   
        add(sourceLabel);
        add(sourceText);
        add(chooseFileButton);  
        add(destinationLabel);
        add(destinationText);
        add(destinationButton);
        add(copyButton);

        //Create myHandler object to add action listeners for the buttons.
        myHandler handler = new myHandler(); //handles the files and copies them 
        chooseFileButton.addActionListener(handler);
        destinationButton.addActionListener(handler);
        copyButton.addActionListener(handler);
        //computeF(name);
    }

    //Inner class to create action listeners    
    private class myHandler implements ActionListener {
        private File selectedSourceFile;
        private File selectedDestinationFile;

        public void actionPerformed(ActionEvent event) 
        {
            int returnVal;
            String selectedFilePath;
            File selectedFile;


            if (event.getSource() == chooseFileButton) 
            {
                returnVal = fc.showOpenDialog(null);
                if (returnVal == JFileChooser.APPROVE_OPTION) 
                {
                    selectedSourceFile = fc.getSelectedFile();
                    sourceText.setText(selectedSourceFile.getName());
                }
            }


            if (event.getSource() == destinationButton) 
            {
                returnVal = fc.showSaveDialog(null);
                if (returnVal == JFileChooser.APPROVE_OPTION) 
                {
                    selectedDestinationFile = fc.getSelectedFile();
                    destinationText.setText(selectedDestinationFile.getName());

                    //where we implement the second file... here is where we'll call to compute the sum of the lines 
                    String name = selectedSourceFile.getName();
                    name = selectedSourceFile.getName().substring(0, name.lastIndexOf(".")) + "_out.txt"; //changed the output file to read ("Orig name here"_out.txt)
                    File destinationFile = new File(selectedDestinationFile.getParentFile(), name); 
                    //destinationFile.deleteOnExit();

                    try {
                        Files.copy(selectedSourceFile.toPath(), destinationFile.toPath()); //copying and computing
                        computeF(destinationFile); //if we can get this to edit the _out.txt file we can do with out creating two seperate files- the previous *_.tmp can just be the *_out.txt
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    }

                }
            }


            if (event.getSource() == copyButton) 
            {
                Path sourcePath = selectedSourceFile.toPath();
                Path destinationPath = selectedDestinationFile.toPath();
                try 
                {
                    Files.copy(sourcePath, destinationPath); 

                } 
                catch (IOException e) 
                {
                    e.printStackTrace();
                }


            }

        }
    }
上面是GUI 然后我的处理方法如下

public static void computeF(File selectedDestinationFile) throws IOException{
        //int i=0;
        if (!selectedDestinationFile.isFile()) // IF CANNOT FIND FILE
        {
            System.out.println("File.txt - Parameter is not an existing file");
            return;
        }

        Scanner fileReader = null; //using the namespace for readability.
        int lineSum=0;
        try
        {
            fileReader = new Scanner(selectedDestinationFile);
        }
        catch (IOException a) //it insists on a try catch
        {
            a.printStackTrace();
        }

        String name = selectedDestinationFile.getName();
        System.setOut(new PrintStream(new FileOutputStream(name)));
        while(fileReader.hasNext()) { 
                    String number = fileReader.next();
                    sum += Integer.parseInt(number);
                    System.out.println(sum);

                    if(fileReader.hasNextLine()) {
                        System.out.println(sum);
                        sum = 0;
                    }
                }


    }
}


/*_______________________________________________________________________________________________________________________*/
                          /*implement after Working script*/
//is there a way to append instead of doing the System.setout? like with this similarly found code.
/* appending how can I implement this??
try(FileWriter fw = new FileWriter("myfile.txt", true);
    BufferedWriter bw = new BufferedWriter(fw);
    PrintWriter out = new PrintWriter(bw))
{
    out.println("the text");
    //more code
    out.println("more text");
    //more code
} catch (IOException e) {
    //exception handling left as an exercise for the reader
}

// or this one? I need to keep the copy but just add to the end so that makes the most sense.  

fout = new FileWriter("filename.txt", true);

*/
/*______________________________________________________________________________________________________________________*/
_________________大约在手术后2小时编辑

忽略Jfilechooser中的override命令,它不应该出现在那里。 另外,对于新代码,基本上我如何让它做我想做的事情,从我知道的工作开始?Aka我怎样才能让它做我需要的事情:

public static void computeF(FILE in)
    {   

        if (!selectedDestinationFile.isFile()) // IF CANNOT FIND FILE
        {
            System.out.println("File.txt - Parameter is not an existing file");
            return;
        }
        Scanner fileReader = null; //using the namespace for readability.
        try
        {
            fileReader = new Scanner(in);
        }
        catch (IOException a) //it insists on a try catch
        {
            a.printStackTrace();
        }
        String name = in.getName();
        fout = new FileWriter(name, true);// to try to append to the copy instead of rewriting the whole file 

    }

我写了一个很长的答案,然后我的电脑死机了。。让我们看看能不能再做一次

对于初学者来说,这些概念中的任何一个都很难理解GUI、文件等。因此,根据我对您的说明的理解,这里有一个可行的解决方案。我尽量不改变你的整体结构太多,这样你会更容易阅读

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class fileSumCompute extends JFrame implements ActionListener {

    private JFileChooser fc;
    private JButton copyButton;
    private JButton chooseFileButton;
    private JButton destinationButton;
    private File workingDirectory;
    private JLabel sourceLabel;
    private JLabel destinationLabel;
    private JTextField sourceText;
    private JTextField sourceFileText;
    private JTextField destinationText;
    private File selectedSourceFile = null;
    private File selectedDestinationFolder;
    private static String textToWrite;
    // my first time creating and opening files without direct command line input.

    public fileSumCompute() {
        // peiced together a couple JfileChooser examples and customized... I cant seem
        // to get it to work without the other path selection and preprograming it into
        // the same directory as source file.
        // It works though.
        super("Compute sum of row. New file = \" *_out.txt\" ");
        setLayout(new GridLayout(3, 3, 5, 5));
        fc = new JFileChooser();

        // Open dialog box to make easier to find files
        workingDirectory = new File(System.getProperty("user.dir"));
        fc.setCurrentDirectory(workingDirectory);

        // create labels and buttons
        chooseFileButton = new JButton("CHOOSE SOURCE FILE");
        destinationButton = new JButton("DESTINATION FOLDER");
        copyButton = new JButton("COMPUTE & SAVE FILE"); // copies file so origonal is preserved
        sourceLabel = new JLabel("SOURCE: ");
        sourceText = new JTextField(10);
        sourceText.setEditable(false);
        destinationLabel = new JLabel("DESTINATION: ");
        destinationText = new JTextField(10);
        destinationText.setEditable(false);

        // JFrame tools
        add(sourceLabel);
        add(sourceText);
        add(chooseFileButton);
        add(destinationLabel);
        add(destinationText);
        add(destinationButton);
        add(copyButton);

        // Add this as action listener.
        chooseFileButton.addActionListener(this);
        destinationButton.addActionListener(this);
        copyButton.addActionListener(this);
        // computeF(name);
    }

    @Override
    public void actionPerformed(ActionEvent arg0) {
        Object event = arg0.getSource();
        int returnVal;

        if (event == chooseFileButton) {
            returnVal = fc.showOpenDialog(null);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                selectedSourceFile = fc.getSelectedFile();
                sourceText.setText(selectedSourceFile.getName());
            }
        } else if (event == destinationButton) {
            fc.setCurrentDirectory(new java.io.File("."));
            fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                selectedDestinationFolder = fc.getSelectedFile();
                destinationText.setText(selectedDestinationFolder.getName());
            }
        } else if (event == copyButton) {
            // where we implement the second file... here is where we'll call to compute the
            // sum of the lines
            String name = selectedSourceFile.getName();
            // changed the output file to read ("Orig name here"_out.txt)
            name = selectedSourceFile.getName().substring(0, name.lastIndexOf(".")) + "_out.txt";
            File destinationFile = new File(selectedDestinationFolder, name);

            try {
                //Files.copy(selectedSourceFile.toPath(), destinationFileFolder.toPath()); // copying and computing
                computeF(selectedSourceFile); // if we can get this to edit the _out.txt file we
                // can do with out creating two seperate files- the previous *_.tmp can just be
                // the *_out.txt
                PrintWriter writer = new PrintWriter(destinationFile, "UTF-8");
                writer.println(textToWrite);
                writer.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }

    public static void computeF(File selectedDestinationFile) throws IOException {
        textToWrite = ""; 
        int sum;
        if (!selectedDestinationFile.isFile()) // IF CANNOT FIND FILE
        {
            System.out.println(selectedDestinationFile.getAbsolutePath() + " - Parameter is not an existing file");
            return;
        }

        try (BufferedReader br = new BufferedReader(new FileReader(selectedDestinationFile.getAbsolutePath()))) {
            String line;
            while ((line = br.readLine()) != null) {
                //Split each line, then check value in the array as an int and add to sum.
               String[] temp = line.split(", ");
               sum = 0;

               for (int i = 0; i < temp.length; i++) 
                   sum = Integer.parseInt(temp[i]); 

               textToWrite+= sum + System.getProperty("line.separator");
            }
        }

    }

    public static void main(String[] args) {
        fileSumCompute cpy1 = new fileSumCompute();
        cpy1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        cpy1.setSize(600, 150);
        cpy1.setVisible(true);
    }
}
我做了一些大的改变,也做了很多小的改变。总的来说,你很接近。让我详细说明一下这些重大变化

首先,我让fileSumCompute只实现ActionListener接口。这样,您就不需要编写私有内部类来处理操作。您可以在需要的任何组件上使用.addActionListenerthis。 接下来,我修改了actionPerformed方法。我把它分成三个部分,每个按钮一个。我还改变了变量的分配方式。你看起来好像离得很近,但有些事情发生了。据我所知,您需要获取一个源文件,读入源文件,对源文件中的每一行求和,然后将这些求和写入一个与源文件同名的新文件,并附加_out。如果我误解了,我道歉。 最后,我改变了computeF方法。再一次,你很接近。我将它改为使用一种简单的方法逐行读取文件,可以在这个网站上找到。它读取中的每一行,使用split方法拆分每一行,然后获取每个数字的int值。 有很多小变化。试着理解它们——这段代码并不完美,但阅读工作代码有助于理解概念


此外,我知道Java和面向对象编程作为一个整体是令人畏惧的。我建议查看Oracle文档,以获得有关GUI等概念的示例,它们有一些很好的示例。最后,不要试图一夜之间学会这些。有很多东西要学,所以一天一天地学习。另外,不要害怕查看这个站点的代码片段。这里有很多很好的解决方案,比如我找到的那个

简化。您试图一次做太多的事情,这会妨碍您的调试能力,您应该做的是孤立地解决每个问题。您当前的问题是读取文件并解析为int,没有其他问题,因此这应该是您尝试的代码,也只有这应该是您显示的代码。现在,看起来您正试图解析一行完整的数字,就好像它是一个单一的数字一样,但这行不通。阅读:星期天晚上我还有3个作业要交,星期一和星期二还有一个考试,所以我需要尽快完成,这与问题无关。我们没有时间阅读不必要的信息。如果你想得到帮助,你可以简化问题。我们都有时间限制。我们有时间时回答问题。无论如何,你需要学会管理你的时间。我们不是来为你写代码的。@Phatez我删除了一堆无关的废话。请在以后只提供相关的评论和代码:谢谢,我会很快地看一遍,然后在下面发布我的任何问题。这意味着什么?我喜欢你把行变成字符串的方式,但是textToWrite的定义是什么?我没有看到字符串定义,它的初始化与Java中的标准相同?textToWrite=;System.getPropertyline.separator的作用是什么;做textToWrite+=sum+System.getPropertyline.separator;我很惊讶你如何清理Jfilechooser脚本并实现它,我将
为了解决所有问题,我们必须持续检查脚本数周-很抱歉,我在后面看到了这一部分的链接。我打算复制文件,然后在每一行的末尾添加总和,但是这能够分离出行并处理文件,假设它不会抛出任何错误,说这些文件已经在使用Jfilechooser,那么这就回答了我的大部分问题(如果不是全部的话)。我会试着玩一点,看看我能做什么,不能做什么。非常感谢。它在编译时也会出现这些错误,我想看看它是添加到行的末尾还是仅仅计算了总和。java:113:错误:FileReader类中的构造函数FileReader不能应用于给定类型;try BufferedReader br=new BufferedReadernew FileReader SelectedDestinationFile.getAbsolutePath{\FileReader.java:15:错误:类FileReader中的构造函数FileReader无法应用于给定类型;try BufferedReader reader=new BufferedReadernew FileReader{好的,我在那里添加了java.io.FileReader以使用javas FileReader,现在程序编译并运行了,我仍然会遇到我以前遇到的相同错误。:线程AWT-EventQueue-0 java.lang.NumberFormatException中的异常java.lang.NumberFormatException:对于输入字符串:1 2 3 4 5…以及下面列出的所有其他内容
public static void computeF(FILE in)
    {   

        if (!selectedDestinationFile.isFile()) // IF CANNOT FIND FILE
        {
            System.out.println("File.txt - Parameter is not an existing file");
            return;
        }
        Scanner fileReader = null; //using the namespace for readability.
        try
        {
            fileReader = new Scanner(in);
        }
        catch (IOException a) //it insists on a try catch
        {
            a.printStackTrace();
        }
        String name = in.getName();
        fout = new FileWriter(name, true);// to try to append to the copy instead of rewriting the whole file 

    }
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class fileSumCompute extends JFrame implements ActionListener {

    private JFileChooser fc;
    private JButton copyButton;
    private JButton chooseFileButton;
    private JButton destinationButton;
    private File workingDirectory;
    private JLabel sourceLabel;
    private JLabel destinationLabel;
    private JTextField sourceText;
    private JTextField sourceFileText;
    private JTextField destinationText;
    private File selectedSourceFile = null;
    private File selectedDestinationFolder;
    private static String textToWrite;
    // my first time creating and opening files without direct command line input.

    public fileSumCompute() {
        // peiced together a couple JfileChooser examples and customized... I cant seem
        // to get it to work without the other path selection and preprograming it into
        // the same directory as source file.
        // It works though.
        super("Compute sum of row. New file = \" *_out.txt\" ");
        setLayout(new GridLayout(3, 3, 5, 5));
        fc = new JFileChooser();

        // Open dialog box to make easier to find files
        workingDirectory = new File(System.getProperty("user.dir"));
        fc.setCurrentDirectory(workingDirectory);

        // create labels and buttons
        chooseFileButton = new JButton("CHOOSE SOURCE FILE");
        destinationButton = new JButton("DESTINATION FOLDER");
        copyButton = new JButton("COMPUTE & SAVE FILE"); // copies file so origonal is preserved
        sourceLabel = new JLabel("SOURCE: ");
        sourceText = new JTextField(10);
        sourceText.setEditable(false);
        destinationLabel = new JLabel("DESTINATION: ");
        destinationText = new JTextField(10);
        destinationText.setEditable(false);

        // JFrame tools
        add(sourceLabel);
        add(sourceText);
        add(chooseFileButton);
        add(destinationLabel);
        add(destinationText);
        add(destinationButton);
        add(copyButton);

        // Add this as action listener.
        chooseFileButton.addActionListener(this);
        destinationButton.addActionListener(this);
        copyButton.addActionListener(this);
        // computeF(name);
    }

    @Override
    public void actionPerformed(ActionEvent arg0) {
        Object event = arg0.getSource();
        int returnVal;

        if (event == chooseFileButton) {
            returnVal = fc.showOpenDialog(null);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                selectedSourceFile = fc.getSelectedFile();
                sourceText.setText(selectedSourceFile.getName());
            }
        } else if (event == destinationButton) {
            fc.setCurrentDirectory(new java.io.File("."));
            fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                selectedDestinationFolder = fc.getSelectedFile();
                destinationText.setText(selectedDestinationFolder.getName());
            }
        } else if (event == copyButton) {
            // where we implement the second file... here is where we'll call to compute the
            // sum of the lines
            String name = selectedSourceFile.getName();
            // changed the output file to read ("Orig name here"_out.txt)
            name = selectedSourceFile.getName().substring(0, name.lastIndexOf(".")) + "_out.txt";
            File destinationFile = new File(selectedDestinationFolder, name);

            try {
                //Files.copy(selectedSourceFile.toPath(), destinationFileFolder.toPath()); // copying and computing
                computeF(selectedSourceFile); // if we can get this to edit the _out.txt file we
                // can do with out creating two seperate files- the previous *_.tmp can just be
                // the *_out.txt
                PrintWriter writer = new PrintWriter(destinationFile, "UTF-8");
                writer.println(textToWrite);
                writer.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }

    public static void computeF(File selectedDestinationFile) throws IOException {
        textToWrite = ""; 
        int sum;
        if (!selectedDestinationFile.isFile()) // IF CANNOT FIND FILE
        {
            System.out.println(selectedDestinationFile.getAbsolutePath() + " - Parameter is not an existing file");
            return;
        }

        try (BufferedReader br = new BufferedReader(new FileReader(selectedDestinationFile.getAbsolutePath()))) {
            String line;
            while ((line = br.readLine()) != null) {
                //Split each line, then check value in the array as an int and add to sum.
               String[] temp = line.split(", ");
               sum = 0;

               for (int i = 0; i < temp.length; i++) 
                   sum = Integer.parseInt(temp[i]); 

               textToWrite+= sum + System.getProperty("line.separator");
            }
        }

    }

    public static void main(String[] args) {
        fileSumCompute cpy1 = new fileSumCompute();
        cpy1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        cpy1.setSize(600, 150);
        cpy1.setVisible(true);
    }
}