以下は、ウェブサイトからの単語数を数えながら、0〜100のゲージプログレスバーを表示するために使用しているコードです。単語数のカウントが終了したら、つまり100に達したら、テキストを表示したいと思います。ただし、以下のコードを使用するとelse
、ゲージチェックメソッドが呼び出されている間もカウントされているため、出力されたステートメントだけが表示されます。これを回避するにはどうすればよいですか?
public void SetGauge(int value) {
this.gg_Progress.setValue(value);
}
public void GaugeCheck () {
if (this.gg_Progress.getValue() == 100) {
progress_Result.setText("The number of words from this website have been successfully counted");
}
else {
progress_Result.setText("The number of words has not been successfully counted");
}
}
if (command == Continue2) {
// write pre-action user code here
switchDisplayable(null, getReading());
// write post-action user code here
DelimiterCheck(tfd_Delimiter.getString());
this.Count();
this.GaugeCheck();
}