public class IncrementalDataCreator implements DataCreator { protected BarMeterApplet applet; public IncrementalDataCreator(){} public void setBarMeterApplet(BarMeterApplet applet){ this.applet = applet; } public void start(){ // 指示値を生成するためのスレッドを作成 Thread thread = new Thread(this); thread.start(); } protected double dataCreate(double x){ return x; } public void run(){ double value; while(true){ for(int i = 0 ; i < 100 ; i++){ // 指示値を生成 value = dataCreate((double)i); // 指示値の設定 applet.setValue(value); try{ Thread.sleep(100); }catch(InterruptedException ex){ return; } } } } }