new TextField()
new TextField( 初期値 )
String 変数 = 《TextField》.getText();
《TextField》.setText( テキスト );
《TextField》.setPromptText( テキスト );
new Button()
new Button( 表示テキスト )
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
package com.tuyano.libro; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; public class App extends Application { Label label; TextField field; Button button; public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { label = new Label("This is JavaFX!"); field = new TextField(); button = new Button("Click"); BorderPane pane = new BorderPane(); pane.setTop(label); pane.setCenter(field); pane.setBottom(button); Scene scene = new Scene(pane, 320, 120); stage.setScene(scene); stage.show(); } }
次へ >> |