Binding Swing component in JavaFX
Just an small example of putting Swing code in JavaFX and binding it as well. Here I am binding the Swing Component Slider with ImageView. The opacity of Image will change according to the slider value. Here is the code :
package newapplication;
import javafx.application.*;
import javafx.scene.image.ImageView;
import javafx.scene.image.Image;
import javafx.ext.swing.*;
var slide = Slider {
minimum: 0
maximum: 100
value: 0
}
Frame {
title: "JavaFX Code", width: 600, height: 600, visible: true
stage: Stage {
content: [
ImageView {
image: Image {
url: "http://gretawire.files.wordpress.com/2007/10/baby1.jpg"
}
opacity: bind (slide.value) / 100.0
},
ComponentView {
component: slide
translateX: 200
translateY: 530
}
]
}
}
Now here we can see the opacity movement with the slider component movement.











Java,JavaScript,Threading,
Optimization and more with Vaibhav 


