Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

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? Or how to bypass this problem?

like image 703
Alex T Avatar asked Jan 02 '23 23:01

Alex T


2 Answers

Since Java9, most of the com.sun.* APIs are unsupported, JDK-internal APIs and they might go away at any time. Also as described in the noteworthy column -

You should plan to move to using the javafx.collections.FXCollections instead.

like image 154
Naman Avatar answered Jan 05 '23 13:01

Naman


Use exposed class since Java 8: ModifiableObservableListBase.

That should handle all your needs.

like image 42
ghostNet Avatar answered Jan 05 '23 14:01

ghostNet