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

質問編集履歴

1

コントローラーを追記しました

2019/07/22 15:48

投稿

uryu_013
uryu_013

スコア12

title CHANGED
File without changes
body CHANGED
@@ -344,4 +344,33 @@
344
344
  </children>
345
345
  </AnchorPane>
346
346
 
347
+ ```
348
+
349
+ ```Java
350
+ package application;
351
+
352
+ import javafx.event.Event;
353
+ import javafx.fxml.FXML;
354
+ import javafx.scene.control.Button;
355
+ import javafx.scene.control.TextField;
356
+ import javafx.scene.layout.AnchorPane;
357
+
358
+ public class GameController {
359
+
360
+ @FXML
361
+ private AnchorPane pane;
362
+ @FXML
363
+ private Button confirmButton;
364
+ @FXML
365
+ private TextField textfield;
366
+
367
+
368
+
369
+ @FXML
370
+ void onconfirmButtonAction(Event event) {
371
+ String text =textfield.getText(); /*2回反応する*/
372
+ System.out.print(text);
373
+ }
374
+ }
375
+
347
376
  ```