Below here is my example code. It loads images saved in a local folder by using the remaining image relative path stored in mysql, but it said unknown source..please help..
public void LoadTimelineImg() throws SQLException {
String sql = "select id, img_url from t_timeline order by id";
Statement selecStatement = conn.createStatement();
ResultSet resultSet = selecStatement.executeQuery(sql);
while(resultSet.next()) {
int id = resultSet.getInt("id");
ArrayList<Image> images = new ArrayList<Image>();
String img_path = resultSet.getString("img_url");
images.add(new Image("\"" + "/application/images/" + img_path + "\""));
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(5), event -> {
imageView.setImage(images.get(count));
count++;
if(count == 5){
count = 0;
}
}));
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play();
}
}