I have a void method that prints some stuff. Can (swing)TextField be filled with the content of my print, somehow? Or should I use something different?
if my method prints:
Hello
how
are
you?
I would like to show on the window, exactly that. Thank you.
private class ButtonListener implements ActionListener
{
@Override
public void actionPerformed(ActionEvent e)
{
label.setText(instance.voidMethodThatPrints());
}
}
It does not work cause setText takes a string, so I was trying to ask you if there's a faster way to make it work.