You can't extend it because it's final.
- Create and instance of Webview class and call
newWebViewInstance.getChildren()
.
- You can create a package with the same package of Webview, but anybody with right sense of Java programming language wouldn't do it.
Update
I don't like to make member/methods of a final class protected . IMHO that is bad programming practise unless in this case.
Why was it made protected?
WebView extends javafx.scene.Parent
And getAllChildren()
is an method of javafx.scene.Parent
which is of protected scope.
protected javafx.collections.ObservableList<javafx.scene.Node> getChildren()
As we now know Webview is a subclass of javafx.scene.Parent
and overrides getChildren()
. If it changes the scope (default being stricter than protected) it breaks the overriding contract.
Hope it's clear now.