学習javafx一hello word
学習の最良の方法はまずhello wordの作成domを見てからapiを見て最後にいろいろな度娘を見て、グーグル..
第一歩環境
まずoracleに行ってfxのsdkをダウンロードするか、jdk 7をダウンロードします.彼はfx sdkを含んで、それからプロジェクトを作成してjfxtrをインポートします.jarはsdkで探しています
直接コードをつけましょう.
第一歩環境
まずoracleに行ってfxのsdkをダウンロードするか、jdk 7をダウンロードします.彼はfx sdkを含んで、それからプロジェクトを作成してjfxtrをインポートします.jarはsdkで探しています
直接コードをつけましょう.
public class Test extends Application {
private void init(Stage primaryStage) {
Group root = new Group();//
primaryStage.setResizable(false);//
primaryStage.setScene(new Scene(root,550,150));//
Text text=new Text(100,100,"hello word");//
text.setFont(new Font(50));//
root.getChildren().add(text);
}
@Override
public void start(Stage primaryStage) throws Exception {
init(primaryStage);
primaryStage.show();
}
public static void main(String[] args) { launch(args); }
}