Re: EventHandler not working in 11.0.2

2019-03-30 Thread Michael Hall



> On Mar 27, 2019, at 1:29 PM, Andrew Munn  wrote:
> 
> How do I listen for mouse events in 11.0.2? IntelliJ's code completion 
> suggests this:
> 
> textField.addEventHandler(MouseEvent.MOUSE_ENTERED, (EventHandler) t -> {
> // do something
> });
> 
> but it fails to compile with error: cannot find symbol T
> 
> Thanks

Isn’t that just generic notation saying it takes an event handler where you 
indicate the specific type.

e.g. this https://docs.oracle.com/javafx/2/events/handlers.htm 
 includes

node.addEventHandler(DragEvent.DRAG_ENTERED, 
new EventHandler() {
public void handle(DragEvent) { ... };
});

showing that this handler is for DragEvent’s, specifically the DRAG_ENTERED 
event in this case. 
So you need to pass your own handler as that parameter. 




Re: EventHandler not working in 11.0.2

2019-03-30 Thread Rachel Greenham
IntelliJ's code completion looks to be wrong then. Just delete the 
"(EventHandler)"


On 27/03/2019 18:29, Andrew Munn wrote:

How do I listen for mouse events in 11.0.2? IntelliJ's code completion
suggests this:

textField.addEventHandler(MouseEvent.MOUSE_ENTERED, (EventHandler) t -> {
  // do something
});

but it fails to compile with error: cannot find symbol T

Thanks




Re: EventHandler not working in 11.0.2

2019-03-27 Thread Siddhesh Rane