teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

内容修正

2020/04/24 12:38

投稿

shiketa
shiketa

スコア4133

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)