J2V8
J2V8 copied to clipboard
How to bind a JAVA object's property to a javascript object's property
Such as, there is a Java class like
class Screen {
private double _width;
public double getWidth {
return _width;
}
public void setWidth(width) {
_width = width;
}
}
I want to bind a Screen object to javascript, and use like "screen.width = 200.0;" in the javascript environment. The Java Object method "setWidth" method is called When the assignment occurs. How to implement it? I will glad to receive your answer.
I am also interested in this. Some example would be very nice.
Hi, Also need this at the moment, did anyone find a way to do this? Thanks
It's not implemented in J2V8, I suppose. If you really want that feature, you may try Javet that allows @V8Property.