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

<ImageView> does not working if initilized in controller

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 7u6
    • javafx
    • javafx 2.2

       
      FXML code -
      ...
      <TreeItem expanded="true" value="1">
      <graphic>
      <ImageView fx:id="folderImageView"/>
      </graphic>
                            <children>
                              <TreeItem value="11" />
                            </children>
                          </TreeItem>
                          
                          <TreeItem expanded="true" value="2">
      <graphic>
      <ImageView fx:id="folderImageView"/>
      </graphic>
                            <children>
                              <TreeItem value="2" />
                            </children>
                          </TreeItem>
      ...

      Its controller code -

      public class LController implements Initializable {
      ..
      @FXML ImageView folderImageView;
      ..
      public void initialize(URL location, ResourceBundle resources) {
      folderImageView.setImage(new Image("/resource/b.png"));
      }


      image b.png is only displayed, in last TreeItem (i.e. which has value=2)

      Can you please suggest?

      Regards,
      Abhishek




            ekrejcir Eva Krejčířová (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: