アットウィキロゴ

00009

package button;
 
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
 
 
public class pro extends Application {
 
 
    public static void main(String[] args) {
        launch(args);
    }
 
 
    @Override
    public void start(Stage primaryStage) {
        Button btn = new Button();
        btn.setText("<-");
        btn.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                System.out.println("Hello World!");
            }
        });
       btn.setLayoutX(150);
btn.setLayoutY(650); 
 
 
 
      Button btn2 = new Button();
        btn2.setText("->");
        btn2.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                System.out.println("ABC");
            }
        });
btn2.setLayoutX(450);
btn2.setLayoutY(650);
 
Group root = new Group();
Scene scene = new Scene(root, 700, 700); 
root.getChildren().add(btn);
root.getChildren().add(btn2);
 
        primaryStage.setTitle("ABC Button");
        primaryStage.setScene(scene);
        primaryStage.show();
    }
 
 
}
 
最終更新:2013年08月26日 12:24