回答編集履歴
1
内容修正
answer
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
ActionEventのsourceには、イベントが発生したコントロール(Buttonとかナニか)が設定されているはずです。
|
2
|
-
[getSource()](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html?is-external=true#getSource--)
|
1
|
+
ActionEventのsourceには、イベントが発生したコントロール(Buttonとかナニか)が設定されているはず。[getSource()](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html?is-external=true#getSource--)
|
3
|
-
[getRowIndex()](https://docs.oracle.com/javase/jp/8/javafx/api/javafx/scene/layout/GridPane.html#getRowIndex-javafx.scene.Node-)は、Nodeを欲しているの
|
2
|
+
[getRowIndex()](https://docs.oracle.com/javase/jp/8/javafx/api/javafx/scene/layout/GridPane.html#getRowIndex-javafx.scene.Node-)は、Nodeを欲しているのだから、型を確認して渡せばいい。
|
4
3
|
|
5
4
|
```java
|
6
5
|
if(event.getSource() instanceOf Node)
|