I am following the StageCoachMain example in Pro JavaFX 2, in chapter 2. However, using NetBeans, for the following section of code:
Which gives the following error (setOnMouseDragged is the same error, method name changed):
method setOnMousePressed in class Node cannot be applied to given types;
required: EventHandler<? super MouseEvent>
found: anonymous EventHandler<MouseEvent>
reason: actual argument <anonymous EventHandler<MouseEvent> cannot be converted to EventHandler<? super MouseEvent> by method invocation conversion.
I have no idea what this means, or why it is caused. Interestingly, the code compiles and runs, although I don't know if properly as I don't know how the errors are affecting it and the rest of the example isn't covered until later in the chapter. What is causing this, how do I fix it and why does it still run with these errors?
As an aside, how do I supply a runtime argument (ie transparent, undecorated) to NetBeans? The book says via Properties -> Run : Arguments, but this does not exist.
"Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." - Mark Twain