• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Have a MenuItem trigger a Filechooser to choose an Image to put in an ImageViewer

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I want to have a MenuItem trigger a Filechooser to choose an Image to put in an ImageViewer, but for some reason the ImageViewer parent view (which is seperate from the root view and is inside the root view) controller initializer keeps throwing a NullPointerException on a addListener statement that I want to use for the ImageViewer to change the Image automatically when the currentImage changes (i.e. when the user chooses a new Image through the MenuItem). It's driving me mad, I'm new to JavaFX, so please be gentle to my stupidity. I won't post my FXMLs as I'm 100% adamant I've binded everything inside SceneBuilder correctly.

Below is my source code, in ImageViewerController.java I've commented to the right of the line that throws the NullPointerException.

MainApp.java


MyImage.java (a model image class to hold properties):


RootController.java


ImageViewerController.java


Error Messages:


reply
    Bookmark Topic Watch Topic
  • New Topic