当我运行此代码(请在下面找到我的代码片段)以从 JFXtras 库中获取 icalenderAgenda 时,它会引发异常
"Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.UnsupportedClassVersionError: jfxtras/scene/control/agenda/Agenda has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0,
谁能告诉我如何解决这个问题。
注意:我的 java 运行时版本是 version 8 build 1.8.0 ,IDE=Netbeans8.2
谢谢!
import java.time.LocalDateTime;
import java.time.Period;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import jfxtras.labs.icalendaragenda.scene.control.agenda.ICalendarAgenda;
import jfxtras.labs.icalendarfx.VCalendar;
/**
*
* @author XY
*/
public class Testicalender extends Application {
@Override
public void start(Stage primaryStage) {
BorderPane root = new BorderPane();
VCalendar vCalendar = new VCalendar();
ICalendarAgenda agenda = new ICalendarAgenda(vCalendar);
root.setCenter(agenda);
//semaine++ ou --
Button increaseweek = new Button(">>");
Button decreaseweek = new Button("<<");
HBox buttonHbox = new HBox(decreaseweek, increaseweek);
// increaseweek.setOnAction((e)->
//
// { LocalDateTime newDisplayedLocalDateTime = agenda.getDisplayedLocalDateTime().plus(Period.ofWeeks(1));
// agenda.setDisplayedLocalDateTime(newDisplayedLocalDateTime);
// });
// decreaseweek.setOnAction((e)->
//
// { LocalDateTime newDisplayedLocalDateTime = agenda.getDisplayedLocalDateTime().minus(Period.ofWeeks(1));
// agenda.setDisplayedLocalDateTime(newDisplayedLocalDateTime);
// });
Scene scene = new Scene(root, 1366, 786);
primaryStage.setScene(scene);
primaryStage.setTitle("test calendarAgenda");
//primaryStage.setOnCloseRequest(e-> System.out.println(vCalendar.toContent()));
primaryStage.show();
}
// /**
// * @param args the command line arguments
// */
public static void main(String[] args) {
launch(args);
}
}