ok thanks

but what should i do it to run? make a new public class where i call this method?
public class textAreaTest { public final JTextArea Center = new JTextArea(400, 500); public void main(String [] args) { JFrame frame2 = new JFrame(); frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame2.setSize(new Dimension(600, 300)); frame2.setLocation(new Point(300, 300)); frame2.setLayout(new BorderLayout()); frame2.setTitle("Home");; //buttons JButton konti1 = new JButton(); konti1.setText("konti1"); JButton konti2 = new JButton(); konti2.setText("konti2"); //East JPanel East = new JPanel(new GridLayout(1,2)); East.add(konti1); East.add(konti2); //layout frame2.add(Center, BorderLayout.CENTER); frame2.add(East, BorderLayout.EAST); // action center konti1.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ try{Center.read(new FileReader("konti1.txt"),null);}catch(IOException ioe){} } }); konti2.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ try{Center.read(new FileReader("konti2.txt"),null);}catch(IOException ioe){} } }); frame2.setVisible(true); } }
--- Update ---
I got it to work

thanks for the help