在下面提到的部分中出现错误:
import com.jfoenix.controls.JFXButton;
import static com.sun.org.apache.xalan.internal.lib.ExsltDatetime.time;
import java.awt.event.MouseEvent;
import java.net.URL;
import java.time.Duration;
import java.util.Calendar;
import java.util.ResourceBundle;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.Label;
public void initialize(URL url, ResourceBundle rb) {
Timeline clock = new Timeline(new KeyFrame(Duration.ZERO, e -> { /*getting error here*/
Calendar cal = Calendar.getInstance();
second = cal.get(Calendar.SECOND);
minute = cal.get(Calendar.MINUTE);
hour = cal.get(Calendar.HOUR);
time.setText(hour + ":" + (minute) + ":" + second);
}),
new KeyFrame(Duration.seconds(1));/*getting error here for seconds(1)*/
);
clock.setCycleCount(Animation.INDEFINITE);
clock.play();
}