Timeline addRandomPeopleFrequently = new Timeline(new KeyFrame(Duration.millis(20), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
if(table.getItems().size()==0)
{
try {
stop();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
int index = RNG.nextInt(table.getItems().size());
count++;
table.getItems().remove(index);
e=System.currentTimeMillis() -s;
}
}));
addRandomPeopleFrequently.setCycleCount(Animation.INDEFINITE);
addRandomPeopleFrequently.play();
我有这段代码,我想在我的表格大小变为 0 时停止时间轴。这段代码没有任何作用,建议做什么