简体   繁体   English

Java 9中的com.sun.javafx.collections

[英]com.sun.javafx.collections in Java 9

I need to recompile java applicattion, written on Java 8. App use com.sun.javafx.collections.ObservableListWrapper class, but when compiling for java 9 error occurs: 我需要重新编译java应用程序,在Java 8上编写。应用程序使用com.sun.javafx.collections.ObservableListWrapper类,但在编译java 9时出现错误:

Error:(3, 22) java: package com.sun.javafx.collections is not visible
  (package com.sun.javafx.collections is declared in module javafx.base,     which does not export it to the unnamed module)

Which class I can use instead of ObservableListWrapper ? 我可以使用哪个类而不是ObservableListWrapper Or how to bypass this problem? 或者如何绕过这个问题?

Since Java9, most of the com.sun.* APIs are unsupported , JDK-internal APIs and they might go away at any time. 从Java9开始,大多数com.sun.* API都不受支持 ,JDK内部API可能会随时消失。 Also as described in the noteworthy column - 另外如值得注意的专栏中所述 -

You should plan to move to using the javafx.collections.FXCollections instead. 您应该计划转而使用javafx.collections.FXCollections

Use exposed class since Java 8: ModifiableObservableListBase . 从Java 8开始使用公开的类: ModifiableObservableListBase

That should handle all your needs. 这应该可以满足您的所有需求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoClassDefFoundError: com/sun/javafx/css/converters/SizeConverter - java.lang.NoClassDefFoundError: com/sun/javafx/css/converters/SizeConverter 是com.sun.javafx.robot.FXRobot专有的 - Is com.sun.javafx.robot.FXRobot proprietary java.lang.NoSuchMethodError: '布尔值 com.sun.prism.ResourceFactory.isDisposed()' JavaFX - java.lang.NoSuchMethodError: 'boolean com.sun.prism.ResourceFactory.isDisposed()' JavaFX JavaFX:线程“JavaFX 应用程序线程”中的异常 java.lang.NullPointerException:无法调用“com.sun.prism.GraphicsPipeline.is3DSupported()” - JavaFX: Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "com.sun.prism.GraphicsPipeline.is3DSupported()" 如何在 Java 中修复“模块 javafx.graphics 不会“打开 com.sun.javafx.text”到未命名模块”的问题? - How to fix " module javafx.graphics does not "opens com.sun.javafx.text" to unnamed module" problem in Java? AutoCompletionBinding 无法访问类 com.sun.javafx.event.EventHandlerManager - AutoCompletionBinding cannot access class com.sun.javafx.event.EventHandlerManager JavaFX 11 部署失败:无法创建任务或键入 javafx:com.sun.javafx.tools.ant:fileset - JavaFX 11 Deployment Failure: failed to create task or type javafx:com.sun.javafx.tools.ant:fileset 无法访问类 com.sun.javafx.util.Utils(在模块 javafx.graphics 中)-JavaFX 和 Eclipse - Cannot access class com.sun.javafx.util.Utils (in module javafx.graphics) - JavaFX & Eclipse Sun的Java软件包命名约定:sun vs. com.sun - Sun's Java Package Naming Convention: sun vs. com.sun 无法访问类 com.sun.javafx.scene.control.skin.resources.ControlResources(在模块 javafx.controls 中) - Cannot access class com.sun.javafx.scene.control.skin.resources.ControlResources (in module javafx.controls)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM