This discussion is archived
2 Replies Latest reply: Feb 27, 2013 12:24 AM by Kayaman RSS

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

Madhav.T.Reddy Newbie
Currently Being Moderated
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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points