Blackberry - jak animować Custom Field?

Stworzyłem niestandardową klasę pola „Szukaj”, aby narysować prostokąt wypełnienia.

class Seek extends Field {
    int fill;
    protected void layout(int width, int height) {
        setExtent(320, 5);
    }
    protected void paint(Graphics graphics) {
        graphics.setColor(Color.RED);
        graphics.fillRect(0, 0, fill, 5);
    }
    protected void setValue(int value) {
        fill = value;
    }
}

Stworzyłem kolejny test klasy, aby ustawić wartość wypełnienia za pomocą zegara

public class TestSeek extends UiApplication {
    public static void main(String[] args) {
        TestSeek gbResults = new TestSeek();
        gbResults.enterEventDispatcher();
    }
    private TestSeek() {
        pushScreen(new ProgressScreen());
    }
}

class ProgressScreen extends MainScreen {
    Timer timer = new Timer();
    int i = 80;
    Seek SeekField = new Seek();

    public ProgressScreen() {
        add(SeekField);
        timer.schedule(new RemindTask(), 100, 10);
    }

    class RemindTask extends TimerTask {
        public void run() {
            if (i < 320) {
                i += 1;
                SeekField.setValue(i);
            } else
                timer.cancel();
        }
    }
}

Ale nie jestem w stanie animować wypełnienia prostokąta.

questionAnswers(0)

yourAnswerToTheQuestion