アットウィキロゴ

kllhh675

package movie;
 
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.scene.Group;
import javafx.scene.shape.*;
import javafx.animation.AnimationTimer;
import javafx.scene.paint.Color;
 import javafx.scene.input.MouseEvent;
import javafx.scene.control.Label;
 
 
public class pro extends Application {
 
int time,fire,left,right;
Label lx;
 
public static void main(String[] args) {
launch(args);
}
 
 
@Override
public void start(Stage primaryStage) {
 
 
 lx=new Label();   
 lx.setText("ABC");
 lx.setLayoutX(100);
 lx.setLayoutY(100);
 lx.setScaleY(5);
 lx.setScaleX(5);
 
Group root = new Group();
Scene scene = new Scene(root, 700, 700); 
 
Button btn = new Button();
        btn.setText("hit");
        btn.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
 
                lx.setText("DFG");
 
            }
        });
btn.setLayoutX(300);
btn.setLayoutY(650); 
 
 
root.getChildren().add(btn);
root.getChildren().add(lx);
 
primaryStage.setTitle("movie");
primaryStage.setScene(scene);
primaryStage.show();
 
new AnimationTimer() {
@Override
public void handle(long now) {
 
time=time+1;
 
if(time>10){
 
time=0;
 
}
}
}.start();
 
 
 
} 
 
 
 
}
最終更新:2013年08月30日 14:42