Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javafxdemo;
- import javafx.application.Application;
- import javafx.event.ActionEvent;
- import javafx.event.EventHandler;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.layout.StackPane;
- import javafx.scene.layout.VBox;
- import javafx.stage.Stage;
- /**
- *
- * @author Dell
- */
- public class Main extends Application{
- int abc=0;
- public static void main(String[] args){
- launch(args);
- }
- @Override
- public void start(Stage stage) throws Exception {
- Button btn = new Button("Click Me");
- Label lbl = new Label();
- btn.setOnAction(new EventHandler<ActionEvent>(){
- @Override
- public void handle(ActionEvent t) {
- //System.out.println("The Button is pressed");
- lbl.setText("Button Pressed");
- }
- });
- VBox root = new VBox();
- root.getChildren().addAll(btn,lbl);
- Scene scene = new Scene(root, 600, 400);
- stage.setScene(scene);
- stage.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement