javax.swing.Timer is what you need - documentation & samples in the usual places. Define a timer task (a "run()" method) that you want to run repeatedly. On click of the start button start a Timer that will run that task every 3000 msec. On click of the stop button stop the timer.
READ THE DOCUMENTATION! ... ... If you can't use Google to find code samples, tutorials, and reference materials you will never be able to write programs, in any language. Getting someone else to do it for you is not an answer.
also implement a loop if that operation is to keep on being repeated
No no no.
The javax.swing.Timer handles the repeating. If you tell a newbie to use a loop in this context you will get a loop with a sleep in it that blocks the EDT and leads inevitably to the post that goes "why isn't by background updating?".