add PDF
This commit is contained in:
BIN
Semester 3/Assignments/Lab1FX/src/JavaLibraryASDV.jar
Normal file
BIN
Semester 3/Assignments/Lab1FX/src/JavaLibraryASDV.jar
Normal file
Binary file not shown.
59
Semester 3/Assignments/Lab1FX/src/lab1fx/Lab1FX.java
Normal file
59
Semester 3/Assignments/Lab1FX/src/lab1fx/Lab1FX.java
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/javafx/FXMain.java to edit this template
|
||||
*/
|
||||
package lab1fx;
|
||||
|
||||
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 style.ButtonStyle;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Athanasios V. Markou
|
||||
*/
|
||||
public class Lab1FX extends Application
|
||||
{
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage)
|
||||
{
|
||||
String style = ButtonStyle.getStyle();
|
||||
Button btn = new Button();
|
||||
btn.setStyle(style);
|
||||
btn.setText("Say 'Hello World'");
|
||||
btn.setOnAction(new EventHandler<ActionEvent>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public void handle(ActionEvent event)
|
||||
{
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
});
|
||||
|
||||
StackPane root = new StackPane();
|
||||
root.getChildren().add(btn);
|
||||
|
||||
Scene scene = new Scene(root, 300, 250);
|
||||
|
||||
primaryStage.setTitle("Hello World!");
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
launch(args);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user