Skip to content
This repository was archived by the owner on Feb 21, 2021. It is now read-only.

Commit 88de947

Browse files
committed
ready for javafx 8
1 parent 5b406c5 commit 88de947

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

FXHelloCV/src/it/polito/elite/teaching/cv/FXHelloCVController.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected void startCamera(ActionEvent event)
5555
if (this.mainApp != null)
5656
{
5757
// get the ImageView object for showing the video stream
58-
final ImageView frameView = (ImageView) mainApp.getRootElement().lookup("#currentFrame");
58+
ImageView frameView = (ImageView) mainApp.getRootElement().lookup("#currentFrame");
5959
// bind an image property with the container for frames
6060
final ObjectProperty<Image> imageProp = new SimpleObjectProperty<>();
6161
frameView.imageProperty().bind(imageProp);
@@ -77,7 +77,15 @@ public void run()
7777
{
7878
// update the image property => update the frame
7979
// shown in the UI
80-
imageProp.set(grabFrame());
80+
final Image imageToShow = grabFrame();
81+
Platform.runLater(new Runnable()
82+
{
83+
@Override
84+
public void run()
85+
{
86+
imageProp.setValue(imageToShow);
87+
}
88+
});
8189
}
8290
};
8391
this.timer = new Timer();

0 commit comments

Comments
 (0)