Javafx 2 如何获取EventDispatcherChain
我正在尝试创建自定义的Javafx 2 如何获取EventDispatcherChain,javafx-2,Javafx 2,我正在尝试创建自定义的ActionEvent。当我尝试分派事件时,场景.dipatchEvent要求我提供一个EventDispatcherChain对象。我没有做任何复杂的事情来实际创建一个新的EventDispatcherChain的实现。如何获取默认的EventDispatcherChain,以便将其传递到场景。dispatchEvent 事件类型 public class SquirrelEventType extends EventType<SquirrelActionEvent
ActionEvent
。当我尝试分派事件时,场景.dipatchEvent
要求我提供一个EventDispatcherChain
对象。我没有做任何复杂的事情来实际创建一个新的EventDispatcherChain
的实现。如何获取默认的EventDispatcherChain,以便将其传递到场景。dispatchEvent
事件类型
public class SquirrelEventType extends EventType<SquirrelActionEvent> {
public SquirrelEventType() {
super("Squirrel.NotifyPreloader");
}
}
下面是对dispatchEvent
SquirrelActionEvent event = new SquirrelActionEvent(0.1d);
mainScene.getEventDispatcher().dispatchEvent(event, null);
事件只是通过Event.firevent()发送,这是一种静态方法。事件只是通过Event.firevent()发送,这是一种静态方法
SquirrelActionEvent event = new SquirrelActionEvent(0.1d);
mainScene.getEventDispatcher().dispatchEvent(event, null);