Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8115346

JavaFX 2.2.25 Group.getChildren() is protected, so can't be used for adding Nodes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 7u25
    • javafx
    • Windows 7

      Don't know if also other versions of JavaFX are involed (just started using this version)
      In documentation and examples Group.getChildren().add(Node n) is used for adding nodes to a group.
      getChildren() is protected and therefore canot be used in an applicatin directly.
      getChildrenUnmodifiable() is public, but does not allow any add, since it is unmodifiable and gives
      java.lang.UnsupportedOperationException
      at java.util.AbstractList.add(AbstractList.java:148)
      at java.util.AbstractList.add(AbstractList.java:108)
      at de.cmk.jfx.Test2.start(Test2.java:47)

      So what is the correct way to add nodes to a group and why there is still the example in the documentation that getChildren().add(Node) is the way?

            psafrata Pavel Ĺ afrata
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: