0

want to append information onto a file based on user selection of minutes (1 min, 15, 30, 45min etc) through radio buttons. for each radio button there are case in switch statement. I am finding it difficult to update the file on a regular interval, continously, does anyone know how to do it based on whatever minute has been chosen. time_int is current time, update_point is the next interval point in which the file needs to be updated? so please help with the UPDATEFILE() method.

]public void radioStartTime(int t) {

    time_int = System.currentTimeMillis(); //time radio button is clicked, clock      the time on click
    System.out.println(sdf.format(time_int));

    /* a case/situation for different radio button selected*/
    switch (t) {

    case 1:
        update_point = time_int + (1*60000);
        System.out.println(sdf.format(update_point));
        UPDATEFILE????(1);
    break;

.....

Edited by 03hasnam: n/a

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by NormR1
0

update the file on a regular interval,

Look at using the Timer class. It can call your update method on a regular interval.

0

it didn't even execute once when I tested it? Can you how me how?

0

Write a small program to test how to use the javax.swing.Timer class and post it here if you have problems getting it to work.
I think the API doc has a sample of how to use it.

Edited by NormR1: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.