i have my first method
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class login implements ActionListener {
//Center
public final JTextArea Center = new JTextArea(400, 500); //laver en final fordi ellers kan action center ikke finde værdien
public void actionPerformed(ActionEvent event) {
//East
JPanel East = new JPanel(new GridLayout(8,2));
East.add(konti1);
East.add(new JLabel((new ReadLastLine().getValue()))); // here is where i want the last line output
East.add(konti2);
East.add(new JLabel("Tilrådighed"));
East.add(new JButton("Konti"));
East.add(new JLabel("Tilrådighed"));
East.add(new JButton("Konti"));
East.add(new JLabel("Tilrådighed"));
East.add(new JLabel(""));
East.add(new JLabel(""));
East.add(new JLabel(""));
East.add(new JLabel(""));
East.add(new JLabel(""));
East.add(new JLabel(""));
East.add(new JLabel(""));
East.add(new JLabel(""));
and then i have my other method
public class readLastLine{
public String readLastLine(){
FileInputStream in = new FileInputStream("test.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine = null, tmp;
while ((tmp = br.readLine()) != null){
strLine = tmp;
}
String lastLine = strLine;
in.close();
return lastLine;
}
}
but i simple can't get it to print the last line it just comes up with a different error everytime i try