Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I am new to swing frame work. I have requirement like when clicking the sta

Madhav.T.ReddyFeb 26 2013 — edited Feb 27 2013
I am new to swing frame work.
I have requirement like when clicking the start button the actionPerformed need to run continuosly.
My Code look like

public class ClickandTable extends JFrame {
// some swing code

public ClickandTable() {
// some swing code

Start.addActionListener(new ActionListener() {
//final ClickandTable lock = new ClickandTable();

public void actionPerformed(ActionEvent event) {
Start.setEnabled(false);

//My Business logic

"})

}

public static void main(String[] args) {

ClickandTable x = new ClickandTable();
x.setVisible(true);
System.out.println("in main");

}

I want execute actionPerformed(ActionEvent event) on every 2 min till my window closed or stop button click.

Could any one give me idea how can over come this.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2013
Added on Feb 26 2013
2 comments
379 views