JavaFXでGUIを作ってみようと思って作ってみたらGUIは出てこなく、html?だけ出てきます。
Esclipeを使っています。
こんな感じです、
Java
1package application; 2 3import java.util.Optional; 4 5import javafx.event.ActionEvent; 6import javafx.fxml.FXML; 7import javafx.scene.control.Alert; 8import javafx.scene.control.Alert.AlertType; 9import javafx.scene.control.Button; 10import javafx.scene.control.ButtonType; 11import javafx.scene.control.TextField; 12 13public class SampleController { 14 15 @FXML 16 private TextField textfield1; 17 18 @FXML 19 private Button button1; 20 21 @FXML 22 void buttonAction1(ActionEvent event) { 23 Alert alert = new Alert(AlertType.CONFIRMATION); 24 alert.setTitle("Hello World"); 25 alert.setContentText("Hello World!!"+textfield1.getText()); 26 Optional<ButtonType> result = alert.showAndWait(); 27 if (result.isPresent() && result.get() == ButtonType.OK) { 28 System.out.println("You clicked OK"); 29 } 30 } 31 32} 33
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。