I am trying to make a small application where when a player clicks a button it gets the values from a file, and then adds to it if the bank number is in the file and if not, makes a new bank number with the amount with it: 

```
package application;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.TextField;

public class Main extends Application {
        @Override
        public void start(Stage primaryStage) {
                try {
                        //BorderPane root = new BorderPane();
                        Parent root = FXMLLoader.load(getClass().getResource("Root.fxml"));
                        Scene scene = new Scene(root,400,400);
                        scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
                        primaryStage.setScene(scene);
                        primaryStage.show();
                } catch(Exception e) {
                        e.printStackTrace();
                }
        }

        public static void main(String[] args) {
                launch(args);
        }
        @FXML
        private TextField banknumber;

        @FXML
        private TextField original;

        @FXML
        private TextField deposited;

        @FXML
        private TextField output;
        @FXML
        protected void onClick(ActionEvent event) throws FileNotFoundException{
                PrintStream diskWriter = new PrintStream(new File("accounts.txt"));
                Scanner diskReader = new Scanner(new File("accounts.txt"));
                int origbal;
                int addtobal = Integer.parseInt(deposited.getText());
                String number = banknumber.getText();
                if(diskReader.next().equals(number)){
                        origbal = diskReader.nextInt();
                        int newbal = origbal+addtobal;
                        diskWriter.println("Number: " + number + " Total: " + newbal);
                }
                else{
                        origbal = Integer.parseInt(original.getText());
                        int newbal = origbal+addtobal;
                        diskWriter.println("Number: " + number + " Total: " + newbal);
                }
                int newbal = origbal+addtobal;
                output.setText("You have added $" + addtobal + " to bank number: " + number + "for a total of $" + newbal);
                diskWriter.close();
        }
}

```

I am getting an error though and I don't know what is wrong with it (The line numbers match up with the paste bin):

```
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.event.Event.fireEvent(Unknown Source)
        at javafx.scene.Node.fireEvent(Unknown Source)
        at javafx.scene.control.Button.fire(Unknown Source)
        at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Unknown Source)
        at com.sun.javafx.scene.control.skin.SkinBase$4.handle(Unknown Source)
        at com.sun.javafx.scene.control.skin.SkinBase$4.handle(Unknown Source)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.event.Event.fireEvent(Unknown Source)
        at javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at javafx.scene.Scene$MouseHandler.access$1900(Unknown Source)
        at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
        at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
        at com.sun.glass.ui.win.WinApplication$3$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.reflect.misc.Trampoline.invoke(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
        ... 45 more
Caused by: java.util.NoSuchElementException
        at java.util.Scanner.throwFor(Unknown Source)
        at java.util.Scanner.next(Unknown Source)
        at application.Main.onClick(Main.java:54)
        ... 54 more

```