I want to remove scroll bar from web view since i'm using web based scroll bar
WebView manages scrolling automatically, so there is no need to put it into a ScrollPane, therefore, You only need to do is control the CSS property overflow or the Webkit-Specify property -webkit-scrollbar (WebView based on Webkit engine).
If you are load page from internet and not from disk, you can't control the CSS yourself, You can inject the css style as following code snippet.
final WebEngine engine = webView.getEngine();
engine.getLoadWorker().stateProperty().addListener(new ChangeListener<State>() {
@Override
public void changed(ObservableValue<? extends State> observable, State oldValue, State newValue) {
if (newValue == State.SUCCEEDED) {
String scriptCode = "customize javascript to inject style";
engine.executeScript(scriptCode);
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With