I have a requirement in swing. I need to open a textarea after regular interval of time (say 15 sec) repeatedly.
Here is the code of display the textarea
import javax.swing.*;
public class TextAreaExample
{
TextAreaExample(){
JFrame f= new JFrame();
JTextArea area=new JTextArea("Welcome to javatpoint");
area.setBounds(10,30, 200,200);
f.add(area);
f.setSize(300,300);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String args[])
{
new TextAreaExample();
}}
Now I think we have to add a thread here which would open the textarea again and again after some interval of time. Right? If so, where should I add the thread related code?
Can anyone add the thread related part in the above code?