This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JavaFX and the fly likes setting EventHandlers in View class from Controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JavaFX
Bookmark "setting EventHandlers in View class from Controller" Watch "setting EventHandlers in View class from Controller" New topic
Author

setting EventHandlers in View class from Controller

Benjamin Trenker
Greenhorn

Joined: Jan 26, 2013
Posts: 1
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
Manuel Petermann
Ranch Hand

Joined: Jul 19, 2011
Posts: 177

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.


Please correct my English.
 
Have you checked out Aspose?
 
subject: setting EventHandlers in View class from Controller
 
It's not a secret anymore!