Good Evening, I am new to GUI in Java. I have the following code :
public class FrameENN extends JFrame {
JButton b1;
JTextArea t1;
JLabel l1;
String c;
eHandler handler = new eHandler();
public FrameENN(String s) {
super(s);
setLayout(new FlowLayout());
b1 = new JButton("Get Result");
t1 = new JTextArea(5, 25);
l1 = new JLabel("");
add(b1);
add(t1);
add(l1);
b1.addActionListener(handler);
}
public class eHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (e.getSource() == b1) {
for (int i = 0; i < 3; i++) {
**System.out.println(i);**
}
}
}
}
}
What can I do when pressing the button to get this System.out.println(i) in JTextArea? I tried with t1.append but it didn't work. Thank You.