diff --git a/Semester 2/Assignments/MP5_CalebFontenot/src/main/java/com/calebfontenot/mp5_calebfontenot/SortArrayList.java b/Semester 2/Assignments/MP5_CalebFontenot/src/main/java/com/calebfontenot/mp5_calebfontenot/SortArrayList.java index dfb52ea..26477c8 100644 --- a/Semester 2/Assignments/MP5_CalebFontenot/src/main/java/com/calebfontenot/mp5_calebfontenot/SortArrayList.java +++ b/Semester 2/Assignments/MP5_CalebFontenot/src/main/java/com/calebfontenot/mp5_calebfontenot/SortArrayList.java @@ -12,7 +12,7 @@ import java.util.ArrayList; * @author caleb */ public class SortArrayList { - + public static void sort(ArrayList list) { // Selection sort implementation for ArrayLists. for (int i = 0; i < list.size(); ++i) { diff --git a/Semester 3/Assignments/JavaLibraryASDV/nbproject/project.properties b/Semester 3/Assignments/JavaLibraryASDV/nbproject/project.properties index c331f8a..c2b089c 100644 --- a/Semester 3/Assignments/JavaLibraryASDV/nbproject/project.properties +++ b/Semester 3/Assignments/JavaLibraryASDV/nbproject/project.properties @@ -75,7 +75,7 @@ jlink.launcher=true jlink.launcher.name=JavaLibraryASDV meta.inf.dir=${src.dir}/META-INF mkdist.disabled=true -platform.active=JDK_1.8 +platform.active=JDK_8__System_ run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/FontDemo1.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/FontDemo1.html new file mode 100644 index 0000000..dde2e43 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/FontDemo1.html @@ -0,0 +1,78 @@ + + + +FontDemo1.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/FontDemo1.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.layout.*;
+import javafx.scene.text.*;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Circle;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class FontDemo1 extends Application {
+    @Override // Override the start method in the Application class
+    public void start(Stage primaryStage) {
+        // Create a pane to hold the circle and label
+        Pane pane = new StackPane();
+        // Create a scene and place it in the stage
+        Scene scene = new Scene(pane);
+        // Add the scene to the stage
+        primaryStage.setScene(scene);
+        //Set the stage title
+        primaryStage.setTitle("FontDemo1");
+        
+        // Create Node circle and add to the Pane
+        Circle circle = new Circle();
+        circle.setRadius(300);
+        circle.setStroke(Color.BLACK);
+        circle.setFill(new Color(0.9, 0.1, 0.1, 0.1));
+        // Add circle to the pane
+        pane.getChildren().add(circle);
+        
+        // Create node label and add to Pane
+        Label label = new Label("JavaFX");
+        // Font created via static method font() and set the font into the label
+        label.setFont(Font.font("Comic Sans MS",
+                               FontWeight.BOLD, FontPosture.ITALIC, 96));
+        label.setTextFill(Color.RED);
+        pane.getChildren().add(label);
+        // Display the stage
+        primaryStage.show();
+    }
+    public static void main(String[] args)
+    {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/FontDemo2.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/FontDemo2.html new file mode 100644 index 0000000..3c863ea --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/FontDemo2.html @@ -0,0 +1,80 @@ + + + +FontDemo2.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/FontDemo2.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.layout.*;
+import javafx.scene.text.*;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Circle;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class FontDemo2 extends Application {
+    @Override // Override the start method in the Application class
+    public void start(Stage primaryStage) {
+        // Create a pane to hold the circle and label
+        Pane pane = new StackPane();
+        // Create a scene and place it in the stage
+        Scene scene = new Scene(pane);
+        // Add the scene to the stage
+        primaryStage.setScene(scene);
+        //Set the stage title
+        primaryStage.setTitle("FontDemo2");
+        
+        // Create Node circle and add to the Pane
+        Circle circle = new Circle();
+        circle.setRadius(300);
+        circle.setStroke(Color.BLACK);
+        circle.setFill(Color.GRAY);
+        //new Color(0.9, 0.1, 0.1, 0.1)
+        // Add circle to the pane
+        pane.getChildren().add(circle);
+        
+        // Create node label and add to Pane
+        Label label = new Label("JavaFX");
+        label.setRotate(90.0);
+        // Font created via static method font() and set the font into the label
+        label.setFont(Font.font("Comic Sans MS",
+                               FontWeight.NORMAL, FontPosture.ITALIC, 96));
+        label.setTextFill(Color.YELLOW);
+        pane.getChildren().add(label);
+        // Display the stage
+        primaryStage.show();
+    }
+    public static void main(String[] args)
+    {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/HandleClickEvent.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/HandleClickEvent.html new file mode 100644 index 0000000..28dc8eb --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/HandleClickEvent.html @@ -0,0 +1,95 @@ + + + +HandleClickEvent.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/HandleClickEvent.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+
+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.BorderPane;
+import javafx.scene.layout.Pane;
+import javafx.stage.Stage;
+import style.ButtonStyle;
+
+/**
+ *
+ * @author Athanasios V. Markou
+ */
+public class HandleClickEvent extends Application
+{
+
+    @Override
+    public void start(Stage primaryStage) throws Exception
+    {
+        Button buttonOK = new Button("OK");
+        buttonOK.setStyle(ButtonStyle.getStyle());
+        OKHandlerClass eventHnadlerOK = new OKHandlerClass();
+        buttonOK.setOnAction(eventHnadlerOK);
+        
+        Button buttonCancel = new Button("Cancel");
+        buttonCancel.setStyle(ButtonStyle.getStyle());
+        CancelHandlerClass eventHandlerCancel = new CancelHandlerClass();
+        buttonCancel.setOnAction(eventHandlerCancel);
+        
+        
+        BorderPane pane = new BorderPane();
+        pane.setTop(buttonOK);
+        pane.setBottom(buttonCancel);
+        Scene scene = new Scene( pane);
+        primaryStage.setScene(scene);
+        primaryStage.show();
+        
+    }
+    public static void main(String[] args)
+    {
+        launch( args);
+    }
+
+    private static class OKHandlerClass implements EventHandler<ActionEvent> {
+        
+        @Override
+        public void handle(ActionEvent event) {
+            System.out.println("You clicked OK!");
+        }
+    }
+ 
+     private static class CancelHandlerClass implements EventHandler<ActionEvent> {
+        
+        @Override
+        public void handle(ActionEvent event) {
+            System.out.println("You clicked Cancel!");
+        }
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/HandleClickEventAnonymous.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/HandleClickEventAnonymous.html new file mode 100644 index 0000000..01c18b9 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/HandleClickEventAnonymous.html @@ -0,0 +1,78 @@ + + + +HandleClickEventAnonymous.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/HandleClickEventAnonymous.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+
+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.Pane;
+import javafx.stage.Stage;
+import style.ButtonStyle;
+
+/**
+ *
+ * @author Athanasios V. Markou
+ */
+public class HandleClickEventAnonymous extends Application
+{
+
+    @Override
+    public void start(Stage primaryStage) throws Exception
+    {
+        Button button = new Button("OK");
+        button.setStyle(ButtonStyle.getStyle());
+        EventHandler eventHnadler = new EventHandler<ActionEvent>(){
+            @Override
+            public void handle(ActionEvent t)
+            {
+                System.out.println("You clicked OK!");
+            }
+        };
+        button.setOnAction(eventHnadler);
+        
+        Pane pane = new Pane();
+        pane.getChildren().add(button);
+        Scene scene = new Scene( pane);
+        primaryStage.setScene(scene);
+        primaryStage.show();
+        
+    }
+    public static void main(String[] args)
+    {
+        launch( args);
+    }
+ 
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/Image1.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/Image1.html new file mode 100644 index 0000000..ef04ae4 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/Image1.html @@ -0,0 +1,78 @@ + + + +Image1.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/Image1.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.scene.layout.*;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class Image1 extends Application {
+
+    @Override // Override the start method in the Application class
+    public void start(Stage primaryStage) throws Exception
+    {
+        // Create a pane to hold the image views
+        Pane pane = new HBox(10);
+        pane.setPadding(new Insets(5, 5, 5, 5));
+        Image image = new Image("image/us.gif");
+        pane.getChildren().add(new ImageView(image));
+        
+        ImageView imageView1 = new ImageView(image);
+        imageView1.setFitHeight(100);
+        imageView1.setFitWidth(100);
+        pane.getChildren().add(imageView1);
+        
+        ImageView imageView2 = new ImageView(image);
+        imageView2.setRotate(90.0);
+        pane.getChildren().add(imageView2);
+        
+        //Create a scene and place it in the stage
+        Scene scene = new Scene(pane);
+        primaryStage.setTitle("Flags"); // Set the stage title
+        primaryStage.setScene(scene); // Place the scene in the stage
+        primaryStage.show(); // Display the stage
+        
+    }
+    public static void main(String[] args)
+    {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ImageArray1.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ImageArray1.html new file mode 100644 index 0000000..bf8e3a8 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ImageArray1.html @@ -0,0 +1,85 @@ + + + +ImageArray1.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray1.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.image.ImageView;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ImageArray1 extends Application {
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+        final String BASE_PATH = "image/flag";
+        ImageView[] images = new ImageView[] {
+            new ImageView(BASE_PATH+"0.gif"),
+            new ImageView(BASE_PATH+"1.gif"),
+            new ImageView(BASE_PATH+"2.gif"),
+            new ImageView(BASE_PATH+"3.gif"),
+            new ImageView(BASE_PATH+"4.gif"),
+            new ImageView(BASE_PATH+"5.gif"),
+            new ImageView(BASE_PATH+"6.gif")
+        };
+        
+        // Create a pane to hold the image views
+        Pane hb = new HBox(10);
+        hb.setPadding(new Insets(5, 5, 5, 5));
+        
+        for (int i = 0; i < 7; ++i) {
+            images[i].setFitWidth(150);
+            images[i].setFitHeight(100);
+            hb.getChildren().add(images[i]);
+        }
+        // Create a scene and place it in the stage
+        Scene scene = new Scene(hb);
+        primaryStage.setTitle("Flags"); // Set the stage title
+        primaryStage.setScene(scene); // Place the scene in the stage
+        primaryStage.show();
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+    
+    
+    
+    
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ImageArray2.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ImageArray2.html new file mode 100644 index 0000000..31ed95b --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ImageArray2.html @@ -0,0 +1,86 @@ + + + +ImageArray2.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray2.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.image.ImageView;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ImageArray2 extends Application {
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+        final String BASE_PATH = "image/flag";
+        ImageView[] images = new ImageView[] {
+            new ImageView(BASE_PATH+"0.gif"),
+            new ImageView(BASE_PATH+"1.gif"),
+            new ImageView(BASE_PATH+"2.gif"),
+            new ImageView(BASE_PATH+"3.gif"),
+            new ImageView(BASE_PATH+"4.gif"),
+            new ImageView(BASE_PATH+"5.gif"),
+            new ImageView(BASE_PATH+"6.gif")
+        };
+        
+        // Create a pane to hold the image views
+        Pane vb = new VBox(10);
+        vb.setPadding(new Insets(5, 5, 5, 5));
+        
+        for (int i = 0; i < 7; ++i) {
+            images[i].setFitWidth(150);
+            images[i].setFitHeight(100);
+            vb.getChildren().add(images[i]);
+        }
+        // Create a scene and place it in the stage
+        Scene scene = new Scene(vb);
+        primaryStage.setTitle("Flags"); // Set the stage title
+        primaryStage.setScene(scene); // Place the scene in the stage
+        primaryStage.show();
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+    
+    
+    
+    
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/Lab2_FX2_F22_part1.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/Lab2_FX2_F22_part1.html index 8449432..9018a40 100644 --- a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/Lab2_FX2_F22_part1.html +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/Lab2_FX2_F22_part1.html @@ -5,21 +5,20 @@ @@ -42,23 +41,23 @@ table {color: #888888; background-color: #313335; font-family: monospace} import style.ButtonStyle; /** * - * @author caleb + * @author caleb */ public class Lab2_FX2_F22_part1 extends Application { @Override - public void start(Stage primaryStage) + public void start(Stage primaryStage) { - String style = ButtonStyle.getStyle(); + 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) + public void handle(ActionEvent event) { - System.out.println("Hello World!"); + System.out.println("Hello World!"); } }); StackPane root = new StackPane(); @@ -72,11 +71,11 @@ table {color: #888888; background-color: #313335; font-family: monospace} } /** - * @param args the command line arguments + * @param args the command line arguments */ - public static void main(String[] args) + public static void main(String[] args) { - launch(args); + launch(args); } } diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowGridPane1.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowGridPane1.html new file mode 100644 index 0000000..48512a9 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowGridPane1.html @@ -0,0 +1,83 @@ + + + +ShowGridPane1.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane1.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.geometry.HPos;
+import javafx.geometry.Insets;
+import javafx.geometry.Pos;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
+import javafx.scene.layout.GridPane;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowGridPane1 extends Application {
+
+    @Override // Override the start method in the Application class
+    public void start(Stage primaryStage) throws Exception {
+        // Create a pane and set its properties
+        GridPane pane = new GridPane();
+        pane.setAlignment(Pos.CENTER);
+        pane.setPadding(new Insets(11.5, 12.5, 13.5, 14.5));
+        pane.setHgap(5.5);
+        pane.setVgap(5.5);
+        
+        // Place nodes in the pane
+        pane.add(new Label("First Name:"), 0, 0);
+        pane.add(new TextField(), 1, 0);
+        pane.add(new Label("MI"), 0, 1);
+        pane.add(new TextField(), 1, 1);
+        pane.add(new Label("Last Name:"), 0, 2);
+        pane.add(new TextField(), 1, 2);
+        Button button = new Button("Add Name");
+        pane.add(button, 1, 3);
+        GridPane.setHalignment(button, HPos.RIGHT);
+        
+        // Create a scene and place it in the stage
+        Scene scene = new Scene(pane);
+        primaryStage.setTitle("ShowGridPane");
+        primaryStage.setScene(scene);
+        primaryStage.show();
+        
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowGridPane2.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowGridPane2.html new file mode 100644 index 0000000..4e0945a --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowGridPane2.html @@ -0,0 +1,103 @@ + + + +ShowGridPane2.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane2.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.HPos;
+import javafx.geometry.Insets;
+import javafx.geometry.Pos;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
+import javafx.scene.layout.GridPane;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowGridPane2 extends Application {
+
+    @Override // Override the start method in the Application class
+    public void start(Stage primaryStage) throws Exception {
+        // Create a pane and set its properties
+        GridPane pane = new GridPane();
+        pane.setAlignment(Pos.CENTER);
+        pane.setPadding(new Insets(11.5, 12.5, 13.5, 14.5));
+        pane.setHgap(5.5);
+        pane.setVgap(5.5);
+        
+        // Place nodes in the pane
+        pane.add(new Label("First Name:"), 0, 0);
+        TextField fName = new TextField();
+        pane.add(fName, 1, 0);
+        pane.add(new Label("MI:"), 0, 1);
+        TextField mInit = new TextField();
+        pane.add(mInit, 1, 1);
+        pane.add(new Label("Last Name:"), 0, 2);
+        TextField lName = new TextField();
+        pane.add(lName, 1, 2);
+        pane.add(new Label("Gender, M/F/nb:"), 0, 3);
+        TextField gender = new TextField();
+        gender.setMaxSize(40, 20);
+        pane.add(gender, 1, 3);
+        Button button = new Button("Add Person");
+        EventHandler eventHnadler = new EventHandler<ActionEvent>(){
+            @Override
+            public void handle(ActionEvent t)
+            {
+                System.out.println("Added person:");
+                System.out.println(fName.getText() + " " + mInit.getText() + " " + lName.getText());
+                System.out.println("Gender: " + gender.getText());
+                
+            }
+        };
+        button.setOnAction(eventHnadler);
+        pane.add(button, 0, 4);
+        GridPane.setHalignment(button, HPos.LEFT);
+        
+        // Create a scene and place it in the stage
+        Scene scene = new Scene(pane);
+        primaryStage.setTitle("ShowGridPane");
+        primaryStage.setScene(scene);
+        primaryStage.show();
+        
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine0.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine0.html new file mode 100644 index 0000000..a4bcab4 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine0.html @@ -0,0 +1,67 @@ + + + +ShowLine0.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine0.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.layout.Pane;
+import javafx.scene.shape.Line;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowLine0 extends Application {
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+    Pane pane = new Pane();
+    Scene scene = new Scene(pane);
+    primaryStage.setTitle("ShowLine"); // Set the stage title
+    primaryStage.setScene(scene); // Place the scene in the stage
+    
+    Line line = new Line();
+    line.setStartX(0.0f);
+    line.setStartY(0.0f);
+    line.setEndX(100.0f);
+    line.setEndY(100.0f);
+    
+    pane.getChildren().add(line);
+    primaryStage.show(); //Display the stage
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine1.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine1.html new file mode 100644 index 0000000..e0a71ec --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine1.html @@ -0,0 +1,80 @@ + + + +ShowLine1.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine1.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.layout.Pane;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Line;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowLine1 extends Application{
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+        Scene scene = new Scene(new LinePane1(), 200, 200);
+        primaryStage.setTitle("ShowLine"); // Set the stage title
+        primaryStage.setScene(scene);
+        primaryStage.show();
+        
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+
+    
+}
+class LinePane1 extends Pane {
+
+        public LinePane1() {
+            Line line1 = new Line(10, 10, 11, 11);
+            line1.endXProperty().bind(widthProperty().subtract(10));
+            line1.endYProperty().bind(heightProperty().subtract(10));
+            line1.setStrokeWidth(5);
+            line1.setStroke(Color.GREEN);
+            this.getChildren().add(line1);
+            
+            Line line2 = new Line(10, 10, 11, 11);
+            line2.startXProperty().bind(widthProperty().subtract(10));
+            line2.endYProperty().bind(heightProperty().subtract(10));
+            line2.setStrokeWidth(5);
+            line2.setStroke(Color.GREEN);
+            this.getChildren().add(line2);
+        }
+    }
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine2.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine2.html new file mode 100644 index 0000000..43bd923 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowLine2.html @@ -0,0 +1,90 @@ + + + +ShowLine2.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine2.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.layout.Pane;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Line;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowLine2 extends Application {
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+        Scene scene = new Scene(new LinePane1(), 200, 200);
+        primaryStage.setTitle("ShowLine"); // Set the stage title
+        primaryStage.setScene(scene);
+        primaryStage.show();
+
+    }
+
+    public static void main(String[] args) {
+        launch(args);
+    }
+
+}
+
+class LinePane1 extends Pane {
+
+    public LinePane1() {
+        Line line1 = new Line(10, 10, 11, 11);
+        line1.endXProperty().bind(widthProperty().subtract(10));
+        line1.endYProperty().bind(heightProperty().subtract(10));
+        line1.setStrokeWidth(5);
+        line1.setStroke(Color.GREEN);
+        this.getChildren().add(line1);
+
+        Line line2 = new Line(10, 10, 11, 11);
+        line2.startXProperty().bind(widthProperty().subtract(10));
+        line2.endYProperty().bind(heightProperty().subtract(10));
+        line2.setStrokeWidth(5);
+        line2.setStroke(Color.GREEN);
+        this.getChildren().add(line2);
+
+        Line line3 = new Line(10, 10, 0, 0);
+        line3.startXProperty().bind(widthProperty().divide(2));
+        line3.endXProperty().bind(widthProperty().divide(2));
+        line3.endYProperty().bind(heightProperty().subtract(10));
+        line3.setStrokeWidth(10);
+        line3.setStroke(Color.RED);
+        this.getChildren().add(line3);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowText1.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowText1.html new file mode 100644 index 0000000..2a81c7a --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/ShowText1.html @@ -0,0 +1,83 @@ + + + +ShowText1.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowText1.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.layout.Pane;
+import javafx.scene.paint.Color;
+import javafx.scene.text.Font;
+import javafx.scene.text.FontPosture;
+import javafx.scene.text.FontWeight;
+import javafx.scene.text.Text;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowText1 extends Application {
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+        // Create a pane to hold the texts
+        Pane pane = new Pane();
+        pane.setPadding(new Insets(5, 5, 5, 5));
+        Text text1 = new Text(40, 40, "Java programming is bold and beautiful!");
+        
+        text1.setFont(Font.font("Impact", FontWeight.BOLD,
+                     FontPosture.ITALIC, 36));
+        pane.getChildren().add(text1);
+        
+        Text text2 = new Text(60, 60, "Java Programming is fun\nand Challenging!");
+        pane.getChildren().add(text2);
+        
+        Text text3 = new Text(10, 100, "C# Programming is not as beautiful as Java programming!\n Try it!");
+        text3.setFill(Color.RED);
+        text3.setUnderline(true);
+        text3.setStrikethrough(true);
+        text3.rotateProperty().add(90);
+        pane.getChildren().add(text3);
+        
+        // Create a scene and place it in the stage
+        Scene scene = new Scene(pane);
+        primaryStage.setTitle("ShowText"); // Set the stage title
+        primaryStage.setScene(scene); // Place the scene in the stage
+        primaryStage.show();
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/TestArc.html b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/TestArc.html new file mode 100644 index 0000000..3fd14e1 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/Printed HTMLs/TestArc.html @@ -0,0 +1,70 @@ + + + +TestArc.java + + + + +
/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/TestArc.java
+
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package lab2_fx2_f22_part1;
+
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.layout.Pane;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class TestArc extends Application {
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+        Pane pane = new Pane();
+        
+        Arc arc = new Arc();
+        arc.setCenterX(50.0f);
+        arc.setCenterY(50.0f);
+        arc.setRadiusX(25.0f);
+        arc.setRadiusY(25.0f);
+        arc.setStartAngle(45.0f);
+        arc.setLength(270.0f);
+        arc.setType(ArcType.ROUND);
+        
+        pane.getChildren().add(arc);
+        Scene scene = new Scene(pane, 400, 300);
+        
+        primaryStage.setScene(scene);
+        primaryStage.show();
+    }
+    public static void main(String[] args) {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/build-impl.xml b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/build-impl.xml index f2db28f..4dececa 100644 --- a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/build-impl.xml +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/build-impl.xml @@ -120,43 +120,7 @@ is divided into following sections: - - - - - - - - - - - - - - - - - - - - - - - - - - Must set platform.home - Must set platform.bootcp - Must set platform.java - Must set platform.javac - - The J2SE Platform is not correctly set up. - Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. - Either open the project in the IDE and setup the Platform with the same name or add it manually. - For example like this: - ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file) - or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used) - + @@ -279,6 +243,20 @@ is divided into following sections: + + + + + + + + + + + + + + @@ -366,7 +344,7 @@ is divided into following sections: - + @@ -417,7 +395,7 @@ is divided into following sections: - + @@ -459,7 +437,7 @@ is divided into following sections: - + @@ -538,7 +516,7 @@ is divided into following sections: - + @@ -566,7 +544,7 @@ is divided into following sections: - + @@ -642,7 +620,7 @@ is divided into following sections: - + @@ -873,9 +851,6 @@ is divided into following sections: - - - @@ -925,7 +900,7 @@ is divided into following sections: - + @@ -959,7 +934,7 @@ is divided into following sections: - + @@ -991,7 +966,7 @@ is divided into following sections: - + @@ -1225,7 +1200,7 @@ is divided into following sections: To run this application from the command line without Ant, try: - ${platform.java} -jar "${dist.jar.resolved}" + java -jar "${dist.jar.resolved}" @@ -1327,8 +1302,8 @@ is divided into following sections: - - + + @@ -1521,19 +1496,16 @@ is divided into following sections: - - - - + - + - + diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/genfiles.properties b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/genfiles.properties index 56f7de1..f7754a3 100644 --- a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/genfiles.properties +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=f9afcb88 build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=8da97ba4 -nbproject/build-impl.xml.script.CRC32=529e3864 -nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48 +nbproject/build-impl.xml.data.CRC32=068e52b6 +nbproject/build-impl.xml.script.CRC32=02ccde00 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.properties b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.properties index 8894d65..9cc2bcd 100644 --- a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.properties +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.properties @@ -71,11 +71,16 @@ javadoc.version=false javadoc.windowtitle= javafx.application.implementation.version=1.0 javafx.binarycss=false +javafx.deploy.adddesktopshortcut=false +javafx.deploy.addstartmenushortcut=false javafx.deploy.allowoffline=true # If true, application update mode is set to 'background', if false, update mode is set to 'eager' javafx.deploy.backgroundupdate=false +javafx.deploy.disable.proxy=false javafx.deploy.embedJNLP=true javafx.deploy.includeDT=true +javafx.deploy.installpermanently=false +javafx.deploy.permissionselevated=false # Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs) javafx.disable.concurrent.runs=false # Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project @@ -96,6 +101,9 @@ javafx.preloader.type=none javafx.rebase.libs=false javafx.run.height=600 javafx.run.width=800 +javafx.signing.blob=false +javafx.signing.enabled=false +javafx.signing.type=notsigned jlink.launcher=false jlink.launcher.name=lab2_FX2_F22_part1 # Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects @@ -109,9 +117,9 @@ manifest.custom.permissions= manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false -platform.active=JDK_1.8 +native.bundling.enabled=false +platform.active=default_platform run.classpath=\ - ${dist.jar}:\ ${javac.classpath}:\ ${build.classes.dir} run.modulepath=\ diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.xml b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.xml index 3beda53..168588e 100644 --- a/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.xml +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/nbproject/project.xml @@ -14,7 +14,6 @@ lab2_FX2_F22_part1 - diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/ShowElipse1.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/ShowElipse1.java new file mode 100644 index 0000000..8ab08aa --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/ShowElipse1.java @@ -0,0 +1,59 @@ + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; +import javafx.scene.shape.Ellipse; +import javafx.stage.Stage; + +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +/** + * + * @author caleb + */ +public class ShowElipse1 extends Application { + + @Override + public void start(Stage primaryStage) throws Exception { + // Create a scene and place it in the stage + Scene scene = new Scene(new My32Ellipses(), 800, 600); + primaryStage.setTitle("Show 32 Ellipses"); + primaryStage.setScene(scene); + primaryStage.show(); + } + public static void main(String[] args) { + launch(args); + } +} +class My32Ellipses extends Pane { + private void paint32Ellipses() { + getChildren().clear(); + // draw 32 rotated ellipses on top of each other + for (int i = 0; i < 32; ++i) { + // Create an ellipse and add it to the pane + Ellipse e1 = new Ellipse( + getWidth() / 2, getHeight() / 2, + getWidth() / 2 - 120, getHeight() / 2 - 120); + e1.setStroke(Color.color(Math.random(), + Math.random(), + Math.random() + ) + ); + e1.setFill(Color.WHITE); + e1.setRotate(i * 180 / 32); + getChildren().add(e1); + } + } + @Override public void setWidth(double width) { + super.setWidth(width); + paint32Ellipses(); + } + @Override public void setHeight(double height) { + super.setHeight(height); + paint32Ellipses(); + } +} \ No newline at end of file diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray1.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray1.java new file mode 100644 index 0000000..a69a082 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray1.java @@ -0,0 +1,57 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.image.ImageView; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ImageArray1 extends Application { + + @Override + public void start(Stage primaryStage) throws Exception { + final String BASE_PATH = "image/flag"; + ImageView[] images = new ImageView[] { + new ImageView(BASE_PATH+"0.gif"), + new ImageView(BASE_PATH+"1.gif"), + new ImageView(BASE_PATH+"2.gif"), + new ImageView(BASE_PATH+"3.gif"), + new ImageView(BASE_PATH+"4.gif"), + new ImageView(BASE_PATH+"5.gif"), + new ImageView(BASE_PATH+"6.gif") + }; + + // Create a pane to hold the image views + Pane hb = new HBox(10); + hb.setPadding(new Insets(5, 5, 5, 5)); + + for (int i = 0; i < 7; ++i) { + images[i].setFitWidth(150); + images[i].setFitHeight(100); + hb.getChildren().add(images[i]); + } + // Create a scene and place it in the stage + Scene scene = new Scene(hb); + primaryStage.setTitle("Flags"); // Set the stage title + primaryStage.setScene(scene); // Place the scene in the stage + primaryStage.show(); + } + public static void main(String[] args) { + launch(args); + } + + + + + +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray2.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray2.java new file mode 100644 index 0000000..0d82eae --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray2.java @@ -0,0 +1,58 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.image.ImageView; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ImageArray2 extends Application { + + @Override + public void start(Stage primaryStage) throws Exception { + final String BASE_PATH = "image/flag"; + ImageView[] images = new ImageView[] { + new ImageView(BASE_PATH+"0.gif"), + new ImageView(BASE_PATH+"1.gif"), + new ImageView(BASE_PATH+"2.gif"), + new ImageView(BASE_PATH+"3.gif"), + new ImageView(BASE_PATH+"4.gif"), + new ImageView(BASE_PATH+"5.gif"), + new ImageView(BASE_PATH+"6.gif") + }; + + // Create a pane to hold the image views + Pane vb = new VBox(10); + vb.setPadding(new Insets(5, 5, 5, 5)); + + for (int i = 0; i < 7; ++i) { + images[i].setFitWidth(150); + images[i].setFitHeight(100); + vb.getChildren().add(images[i]); + } + // Create a scene and place it in the stage + Scene scene = new Scene(vb); + primaryStage.setTitle("Flags"); // Set the stage title + primaryStage.setScene(scene); // Place the scene in the stage + primaryStage.show(); + } + public static void main(String[] args) { + launch(args); + } + + + + + +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane1.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane1.java new file mode 100644 index 0000000..3b1e361 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane1.java @@ -0,0 +1,54 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.geometry.HPos; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ShowGridPane1 extends Application { + + @Override // Override the start method in the Application class + public void start(Stage primaryStage) throws Exception { + // Create a pane and set its properties + GridPane pane = new GridPane(); + pane.setAlignment(Pos.CENTER); + pane.setPadding(new Insets(11.5, 12.5, 13.5, 14.5)); + pane.setHgap(5.5); + pane.setVgap(5.5); + + // Place nodes in the pane + pane.add(new Label("First Name:"), 0, 0); + pane.add(new TextField(), 1, 0); + pane.add(new Label("MI"), 0, 1); + pane.add(new TextField(), 1, 1); + pane.add(new Label("Last Name:"), 0, 2); + pane.add(new TextField(), 1, 2); + Button button = new Button("Add Name"); + pane.add(button, 1, 3); + GridPane.setHalignment(button, HPos.RIGHT); + + // Create a scene and place it in the stage + Scene scene = new Scene(pane); + primaryStage.setTitle("ShowGridPane"); + primaryStage.setScene(scene); + primaryStage.show(); + + } + public static void main(String[] args) { + launch(args); + } +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane2.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane2.java new file mode 100644 index 0000000..25bb3e1 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane2.java @@ -0,0 +1,74 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.geometry.HPos; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ShowGridPane2 extends Application { + + @Override // Override the start method in the Application class + public void start(Stage primaryStage) throws Exception { + // Create a pane and set its properties + GridPane pane = new GridPane(); + pane.setAlignment(Pos.CENTER); + pane.setPadding(new Insets(11.5, 12.5, 13.5, 14.5)); + pane.setHgap(5.5); + pane.setVgap(5.5); + + // Place nodes in the pane + pane.add(new Label("First Name:"), 0, 0); + TextField fName = new TextField(); + pane.add(fName, 1, 0); + pane.add(new Label("MI:"), 0, 1); + TextField mInit = new TextField(); + pane.add(mInit, 1, 1); + pane.add(new Label("Last Name:"), 0, 2); + TextField lName = new TextField(); + pane.add(lName, 1, 2); + pane.add(new Label("Gender, M/F/nb:"), 0, 3); + TextField gender = new TextField(); + gender.setMaxSize(40, 20); + pane.add(gender, 1, 3); + Button button = new Button("Add Person"); + EventHandler eventHnadler = new EventHandler(){ + @Override + public void handle(ActionEvent t) + { + System.out.println("Added person:"); + System.out.println(fName.getText() + " " + mInit.getText() + " " + lName.getText()); + System.out.println("Gender: " + gender.getText()); + + } + }; + button.setOnAction(eventHnadler); + pane.add(button, 0, 4); + GridPane.setHalignment(button, HPos.LEFT); + + // Create a scene and place it in the stage + Scene scene = new Scene(pane); + primaryStage.setTitle("ShowGridPane"); + primaryStage.setScene(scene); + primaryStage.show(); + + } + public static void main(String[] args) { + launch(args); + } +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine0.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine0.java new file mode 100644 index 0000000..407e690 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine0.java @@ -0,0 +1,39 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.layout.Pane; +import javafx.scene.shape.Line; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ShowLine0 extends Application { + + @Override + public void start(Stage primaryStage) throws Exception { + Pane pane = new Pane(); + Scene scene = new Scene(pane); + primaryStage.setTitle("ShowLine"); // Set the stage title + primaryStage.setScene(scene); // Place the scene in the stage + + Line line = new Line(); + line.setStartX(0.0f); + line.setStartY(0.0f); + line.setEndX(100.0f); + line.setEndY(100.0f); + + pane.getChildren().add(line); + primaryStage.show(); //Display the stage + } + public static void main(String[] args) { + launch(args); + } + +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine1.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine1.java new file mode 100644 index 0000000..76eeaa2 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine1.java @@ -0,0 +1,52 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; +import javafx.scene.shape.Line; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ShowLine1 extends Application{ + + @Override + public void start(Stage primaryStage) throws Exception { + Scene scene = new Scene(new LinePane1(), 200, 200); + primaryStage.setTitle("ShowLine"); // Set the stage title + primaryStage.setScene(scene); + primaryStage.show(); + + } + public static void main(String[] args) { + launch(args); + } + + +} +class LinePane1 extends Pane { + + public LinePane1() { + Line line1 = new Line(10, 10, 11, 11); + line1.endXProperty().bind(widthProperty().subtract(10)); + line1.endYProperty().bind(heightProperty().subtract(10)); + line1.setStrokeWidth(5); + line1.setStroke(Color.GREEN); + this.getChildren().add(line1); + + Line line2 = new Line(10, 10, 11, 11); + line2.startXProperty().bind(widthProperty().subtract(10)); + line2.endYProperty().bind(heightProperty().subtract(10)); + line2.setStrokeWidth(5); + line2.setStroke(Color.GREEN); + this.getChildren().add(line2); + } + } \ No newline at end of file diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine2.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine2.java new file mode 100644 index 0000000..62deebc --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine2.java @@ -0,0 +1,61 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; +import javafx.scene.shape.Line; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ShowLine2 extends Application { + + @Override + public void start(Stage primaryStage) throws Exception { + Scene scene = new Scene(new LinePane1(), 200, 200); + primaryStage.setTitle("ShowLine"); // Set the stage title + primaryStage.setScene(scene); + primaryStage.show(); + + } + + public static void main(String[] args) { + launch(args); + } + +} + +class LinePane1 extends Pane { + + public LinePane1() { + Line line1 = new Line(10, 10, 11, 11); + line1.endXProperty().bind(widthProperty().subtract(10)); + line1.endYProperty().bind(heightProperty().subtract(10)); + line1.setStrokeWidth(5); + line1.setStroke(Color.GREEN); + this.getChildren().add(line1); + + Line line2 = new Line(10, 10, 11, 11); + line2.startXProperty().bind(widthProperty().subtract(10)); + line2.endYProperty().bind(heightProperty().subtract(10)); + line2.setStrokeWidth(5); + line2.setStroke(Color.GREEN); + this.getChildren().add(line2); + + Line line3 = new Line(10, 10, 0, 0); + line3.startXProperty().bind(widthProperty().divide(2)); + line3.endXProperty().bind(widthProperty().divide(2)); + line3.endYProperty().bind(heightProperty().subtract(10)); + line3.setStrokeWidth(10); + line3.setStroke(Color.RED); + this.getChildren().add(line3); + } +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowText1.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowText1.java new file mode 100644 index 0000000..8abc748 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowText1.java @@ -0,0 +1,54 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; +import javafx.scene.text.Font; +import javafx.scene.text.FontPosture; +import javafx.scene.text.FontWeight; +import javafx.scene.text.Text; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class ShowText1 extends Application { + + @Override + public void start(Stage primaryStage) throws Exception { + // Create a pane to hold the texts + Pane pane = new Pane(); + pane.setPadding(new Insets(5, 5, 5, 5)); + Text text1 = new Text(40, 40, "Java programming is bold and beautiful!"); + + text1.setFont(Font.font("Impact", FontWeight.BOLD, + FontPosture.ITALIC, 36)); + pane.getChildren().add(text1); + + Text text2 = new Text(60, 60, "Java Programming is fun\nand Challenging!"); + pane.getChildren().add(text2); + + Text text3 = new Text(10, 100, "C# Programming is not as beautiful as Java programming!\n Try it!"); + text3.setFill(Color.RED); + text3.setUnderline(true); + text3.setStrikethrough(true); + text3.rotateProperty().add(90); + pane.getChildren().add(text3); + + // Create a scene and place it in the stage + Scene scene = new Scene(pane); + primaryStage.setTitle("ShowText"); // Set the stage title + primaryStage.setScene(scene); // Place the scene in the stage + primaryStage.show(); + } + public static void main(String[] args) { + launch(args); + } +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/TestArc.java b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/TestArc.java new file mode 100644 index 0000000..4798ec0 --- /dev/null +++ b/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/TestArc.java @@ -0,0 +1,42 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package lab2_fx2_f22_part1; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.layout.Pane; +import javafx.scene.shape.Arc; +import javafx.scene.shape.ArcType; +import javafx.stage.Stage; + +/** + * + * @author caleb + */ +public class TestArc extends Application { + + @Override + public void start(Stage primaryStage) throws Exception { + Pane pane = new Pane(); + + Arc arc = new Arc(); + arc.setCenterX(50.0f); + arc.setCenterY(50.0f); + arc.setRadiusX(25.0f); + arc.setRadiusY(25.0f); + arc.setStartAngle(45.0f); + arc.setLength(270.0f); + arc.setType(ArcType.ROUND); + + pane.getChildren().add(arc); + Scene scene = new Scene(pane, 400, 300); + + primaryStage.setScene(scene); + primaryStage.show(); + } + public static void main(String[] args) { + launch(args); + } +} diff --git a/Semester 3/Assignments/lab2_FX2_F22_part1/us.gif b/Semester 3/Assignments/lab2_FX2_F22_part1/us.gif deleted file mode 100755 index 2523dfc..0000000 Binary files a/Semester 3/Assignments/lab2_FX2_F22_part1/us.gif and /dev/null differ diff --git a/Semester 3/ZIPs/Lab2_FX2_F22_part2-CalebFontenot.zip b/Semester 3/ZIPs/Lab2_FX2_F22_part2-CalebFontenot.zip new file mode 100644 index 0000000..1db1db3 Binary files /dev/null and b/Semester 3/ZIPs/Lab2_FX2_F22_part2-CalebFontenot.zip differ diff --git a/java8-openjfx-8.u202-9-x86_64.pkg.tar.zst b/java8-openjfx-8.u202-9-x86_64.pkg.tar.zst new file mode 100644 index 0000000..813d02c Binary files /dev/null and b/java8-openjfx-8.u202-9-x86_64.pkg.tar.zst differ diff --git a/java8-openjfx-doc-8.u202-9-x86_64.pkg.tar.zst b/java8-openjfx-doc-8.u202-9-x86_64.pkg.tar.zst new file mode 100644 index 0000000..b9efcc6 Binary files /dev/null and b/java8-openjfx-doc-8.u202-9-x86_64.pkg.tar.zst differ diff --git a/java8-openjfx-src-8.u202-9-x86_64.pkg.tar.zst b/java8-openjfx-src-8.u202-9-x86_64.pkg.tar.zst new file mode 100644 index 0000000..147475e Binary files /dev/null and b/java8-openjfx-src-8.u202-9-x86_64.pkg.tar.zst differ