You should not use com.sun
classes in your code. Such classes are not part of the public API which is supported by Oracle or the OpenJDK for the JDK and JavaFX. Oracle makes no guarantees that com.sun
classes will be backwards compatible between releases.
Oracle do guarantee that the public APIs, e.g., java.*
and javafx.*
will be backwards compatible between releases. So stick to using only supported public APIs in your code and your code should work much better across different Java releases.
For the particular control you are trying to utilize (the webkit implementation embedded in JavaFX), the public API for that is the javafx.scene.web.WebView
API.