• 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

setting EventHandlers in View class from Controller

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

i've just started playing around with JavaFx2 and Scala. Trying to achieve a 'Passive View' I soon ran into problems setting EventHandlers for my buttons from within the controller class, 'cause the EventHandler never gets triggered when setting it this way:



It would be nice if anybody could tell me how it is possible doing it this way instead of setting the EventHandler directly in the View - class.

thanks in advance,
Benni
 
Ranch Hand
Posts: 177
Hibernate Python Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know how you are setting up your view. If you are using a FxmlClassLoader you could use something like

You would obviously have to change it to Scala. If you are doing this without fxml i am not sure if that is a build in feature of javafx. I am not that familiar with Scala though.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic