change text

i had created one application in which i need to do little thingafter running my application it will display one j frame with jtextfiled with some text in itafter 5 second i want to change that content in that textfliedhow to do thatpleaseeeeeeeeeeetell
[298 byte] By [bhavin123400a] at [2007-11-27 6:12:52]
# 1

You can use Timerimport javax.swing.Timer;

private Timer tt;

static int sec=0, endSec=5000;

// where ever u want to start

tt=new Timer(0,new TimerListener());

tt.start();

class TimerListener implements ActionListener

{

public void actionPerformed(ActionEvent evt)

{

sec++;

if(sec==endSec)

// set the text here

}

}

haishaia at 2007-7-12 17:20:29 > top of Java-index,Desktop,Core GUI APIs...
# 2

or you could actually use the Timer's timer:

Timer timer = new Timer(5000, new ActionListener() {

public void actionPerformed(ActionEvent e) {

label.setText("Changed");

}

});

timer.setRepeats(false);

timer.start();

dwga at 2007-7-12 17:20:29 > top of Java-index,Desktop,Core GUI APIs...
# 3
thank you so much problem sloved
bhavin123400a at 2007-7-12 17:20:29 > top of Java-index,Desktop,Core GUI APIs...