There is no FXCollections.observableList



  • Establishment JavaFX draft, Intellij Idea No static method observableArrayList in class FXCollectionsin the library javafx.collections

    All the other methods don't work, either, even though the class and methods are in it.

    In the class. FXCollections There are imports:

    import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;

    which Idea He doesn't find it either, and it looks like he's really gone. Jdk♪ Maybe that's the problem, but I don't know how to decide.

    Updating

    The thing is, this import. import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;in the JDK class itself, and in com.sun there's a collections package, but it doesn't contain annotations package, neither. javafx.collectionsI suspect that this is the problem (maybe it's because of the incorrect import of the class and not connected), but how do we solve it, and why does jdk have import from a non-existent package? Using JDK 1.8

    How can com.sun be extra at JDK?



  • Problem solved, the reason was my disrespect instead.

    ObservableList datas = FXCollections.observableArrayList();

    I wrote.

    ObservableList<XYChart.Data> datas = new FXCollections.observableArrayList();
    

    Of course, there was no such class. Thank you for your time.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2