ugh that lab was fun but draining
This commit is contained in:
parent
ae9b81fa91
commit
89d0c45459
@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||||||
* @author caleb
|
* @author caleb
|
||||||
*/
|
*/
|
||||||
public class SortArrayList {
|
public class SortArrayList {
|
||||||
|
|
||||||
public static void sort(ArrayList<Number> list) {
|
public static void sort(ArrayList<Number> list) {
|
||||||
// Selection sort implementation for ArrayLists.
|
// Selection sort implementation for ArrayLists.
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
|
@ -75,7 +75,7 @@ jlink.launcher=true
|
|||||||
jlink.launcher.name=JavaLibraryASDV
|
jlink.launcher.name=JavaLibraryASDV
|
||||||
meta.inf.dir=${src.dir}/META-INF
|
meta.inf.dir=${src.dir}/META-INF
|
||||||
mkdist.disabled=true
|
mkdist.disabled=true
|
||||||
platform.active=JDK_1.8
|
platform.active=JDK_8__System_
|
||||||
run.classpath=\
|
run.classpath=\
|
||||||
${javac.classpath}:\
|
${javac.classpath}:\
|
||||||
${build.classes.dir}
|
${build.classes.dir}
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>FontDemo1.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/FontDemo1.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license</span>
|
||||||
|
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.*;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.*;
|
||||||
|
<span class="literal">import</span> javafx.scene.text.*;
|
||||||
|
<span class="literal">import</span> javafx.scene.paint.Color;
|
||||||
|
<span class="literal">import</span> javafx.scene.shape.Circle;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> FontDemo1 <span class="literal">extends</span> Application {
|
||||||
|
@Override <span class="comment">// Override the start method in the Application class</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> start(Stage primaryStage) {
|
||||||
|
<span class="comment">// Create a pane to hold the circle and label</span>
|
||||||
|
Pane pane = <span class="literal">new</span> StackPane();
|
||||||
|
<span class="comment">// Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane);
|
||||||
|
<span class="comment">// Add the scene to the stage</span>
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
<span class="comment">//Set the stage title</span>
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">FontDemo1</span><span class="string">"</span>);
|
||||||
|
|
||||||
|
<span class="comment">// Create Node circle and add to the Pane</span>
|
||||||
|
Circle circle = <span class="literal">new</span> Circle();
|
||||||
|
circle.setRadius(<span class="number">300</span>);
|
||||||
|
circle.setStroke(Color.BLACK);
|
||||||
|
circle.setFill(<span class="literal">new</span> Color(<span class="number">0.9</span>, <span class="number">0.1</span>, <span class="number">0.1</span>, <span class="number">0.1</span>));
|
||||||
|
<span class="comment">// Add circle to the pane</span>
|
||||||
|
pane.getChildren().add(circle);
|
||||||
|
|
||||||
|
<span class="comment">// Create node label and add to Pane</span>
|
||||||
|
Label label = <span class="literal">new</span> Label(<span class="string">"</span><span class="string">JavaFX</span><span class="string">"</span>);
|
||||||
|
<span class="comment">// Font created via static method font() and set the font into the label</span>
|
||||||
|
label.setFont(Font.font(<span class="string">"</span><span class="string">Comic Sans MS</span><span class="string">"</span>,
|
||||||
|
FontWeight.BOLD, FontPosture.ITALIC, <span class="number">96</span>));
|
||||||
|
label.setTextFill(Color.RED);
|
||||||
|
pane.getChildren().add(label);
|
||||||
|
<span class="comment">// Display the stage</span>
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> main(String[] args)
|
||||||
|
{
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,80 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>FontDemo2.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/FontDemo2.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license</span>
|
||||||
|
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.*;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.*;
|
||||||
|
<span class="literal">import</span> javafx.scene.text.*;
|
||||||
|
<span class="literal">import</span> javafx.scene.paint.Color;
|
||||||
|
<span class="literal">import</span> javafx.scene.shape.Circle;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> FontDemo2 <span class="literal">extends</span> Application {
|
||||||
|
@Override <span class="comment">// Override the start method in the Application class</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> start(Stage primaryStage) {
|
||||||
|
<span class="comment">// Create a pane to hold the circle and label</span>
|
||||||
|
Pane pane = <span class="literal">new</span> StackPane();
|
||||||
|
<span class="comment">// Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane);
|
||||||
|
<span class="comment">// Add the scene to the stage</span>
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
<span class="comment">//Set the stage title</span>
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">FontDemo2</span><span class="string">"</span>);
|
||||||
|
|
||||||
|
<span class="comment">// Create Node circle and add to the Pane</span>
|
||||||
|
Circle circle = <span class="literal">new</span> Circle();
|
||||||
|
circle.setRadius(<span class="number">300</span>);
|
||||||
|
circle.setStroke(Color.BLACK);
|
||||||
|
circle.setFill(Color.GRAY);
|
||||||
|
<span class="comment">//new Color(0.9, 0.1, 0.1, 0.1)</span>
|
||||||
|
<span class="comment">// Add circle to the pane</span>
|
||||||
|
pane.getChildren().add(circle);
|
||||||
|
|
||||||
|
<span class="comment">// Create node label and add to Pane</span>
|
||||||
|
Label label = <span class="literal">new</span> Label(<span class="string">"</span><span class="string">JavaFX</span><span class="string">"</span>);
|
||||||
|
label.setRotate(<span class="number">90.0</span>);
|
||||||
|
<span class="comment">// Font created via static method font() and set the font into the label</span>
|
||||||
|
label.setFont(Font.font(<span class="string">"</span><span class="string">Comic Sans MS</span><span class="string">"</span>,
|
||||||
|
FontWeight.NORMAL, FontPosture.ITALIC, <span class="number">96</span>));
|
||||||
|
label.setTextFill(Color.YELLOW);
|
||||||
|
pane.getChildren().add(label);
|
||||||
|
<span class="comment">// Display the stage</span>
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> main(String[] args)
|
||||||
|
{
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,95 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>HandleClickEvent.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST2 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST3 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST4 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/HandleClickEvent.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.event.ActionEvent;
|
||||||
|
<span class="literal">import</span> javafx.event.EventHandler;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.Button;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.BorderPane;
|
||||||
|
<span class="comment">import</span> <span class="comment">javafx</span><span class="comment">.</span><span class="comment">scene</span><span class="comment">.</span><span class="comment">layout</span><span class="comment">.</span><span class="comment">Pane</span><span class="comment">;</span>
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
<span class="literal">import</span> style.ButtonStyle;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">Athanasios</span> <span class="comment">V</span><span class="comment">.</span> <span class="comment">Markou</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> HandleClickEvent <span class="literal">extends</span> Application
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception
|
||||||
|
{
|
||||||
|
Button buttonOK = <span class="literal">new</span> Button(<span class="string">"</span><span class="string">OK</span><span class="string">"</span>);
|
||||||
|
buttonOK.setStyle(ButtonStyle.<span class="ST2">getStyle</span>());
|
||||||
|
<span class="ST2">OKHandlerClass</span> eventHnadlerOK = <span class="literal">new</span> OKHandlerClass();
|
||||||
|
buttonOK.setOnAction(eventHnadlerOK);
|
||||||
|
|
||||||
|
Button buttonCancel = <span class="literal">new</span> Button(<span class="string">"</span><span class="string">Cancel</span><span class="string">"</span>);
|
||||||
|
buttonCancel.setStyle(ButtonStyle.<span class="ST2">getStyle</span>());
|
||||||
|
<span class="ST2">CancelHandlerClass</span> eventHandlerCancel = <span class="literal">new</span> CancelHandlerClass();
|
||||||
|
buttonCancel.setOnAction(eventHandlerCancel);
|
||||||
|
|
||||||
|
|
||||||
|
BorderPane pane = <span class="literal">new</span> BorderPane();
|
||||||
|
pane.setTop(buttonOK);
|
||||||
|
pane.setBottom(buttonCancel);
|
||||||
|
Scene scene = <span class="literal">new</span> Scene( pane);
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST3">main</span>(String[] args)
|
||||||
|
{
|
||||||
|
<span class="ST2">launch</span>( args);
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="literal">private</span> <span class="literal">static</span> <span class="literal">class</span> <span class="ST2">OKHandlerClass</span> <span class="literal">implements</span> EventHandler<ActionEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">handle</span>(ActionEvent event) {
|
||||||
|
System.<span class="ST4">out</span>.println(<span class="string">"</span><span class="string">You clicked OK!</span><span class="string">"</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="literal">private</span> <span class="literal">static</span> <span class="literal">class</span> <span class="ST2">CancelHandlerClass</span> <span class="literal">implements</span> EventHandler<ActionEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">handle</span>(ActionEvent event) {
|
||||||
|
System.<span class="ST4">out</span>.println(<span class="string">"</span><span class="string">You clicked Cancel!</span><span class="string">"</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,78 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>HandleClickEventAnonymous.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST2 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST3 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST4 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/HandleClickEventAnonymous.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.event.ActionEvent;
|
||||||
|
<span class="literal">import</span> javafx.event.EventHandler;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.Button;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
<span class="literal">import</span> style.ButtonStyle;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">Athanasios</span> <span class="comment">V</span><span class="comment">.</span> <span class="comment">Markou</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> HandleClickEventAnonymous <span class="literal">extends</span> Application
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception
|
||||||
|
{
|
||||||
|
Button button = <span class="literal">new</span> Button(<span class="string">"</span><span class="string">OK</span><span class="string">"</span>);
|
||||||
|
button.setStyle(ButtonStyle.<span class="ST2">getStyle</span>());
|
||||||
|
EventHandler eventHnadler = <span class="literal">new</span> EventHandler<ActionEvent>(){
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">handle</span>(ActionEvent t)
|
||||||
|
{
|
||||||
|
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">You clicked OK!</span><span class="string">"</span>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
button.setOnAction(eventHnadler);
|
||||||
|
|
||||||
|
Pane pane = <span class="literal">new</span> Pane();
|
||||||
|
pane.getChildren().add(button);
|
||||||
|
Scene scene = <span class="literal">new</span> Scene( pane);
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST4">main</span>(String[] args)
|
||||||
|
{
|
||||||
|
<span class="ST2">launch</span>( args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,78 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Image1.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/Image1.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Insets;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.image.Image;
|
||||||
|
<span class="literal">import</span> javafx.scene.image.ImageView;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.*;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> Image1 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override <span class="comment">// Override the start method in the Application class</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception
|
||||||
|
{
|
||||||
|
<span class="comment">// Create a pane to hold the image views</span>
|
||||||
|
Pane pane = <span class="literal">new</span> HBox(<span class="number">1</span><span class="number">0</span>);
|
||||||
|
pane.setPadding(<span class="literal">new</span> Insets(<span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>));
|
||||||
|
Image image = <span class="literal">new</span> Image(<span class="string">"</span><span class="string">image/us.gif</span><span class="string">"</span>);
|
||||||
|
pane.getChildren().add(<span class="literal">new</span> ImageView(image));
|
||||||
|
|
||||||
|
ImageView imageView1 = <span class="literal">new</span> ImageView(image);
|
||||||
|
imageView1.setFitHeight(<span class="number">1</span><span class="number">00</span>);
|
||||||
|
imageView1.setFitWidth(<span class="number">1</span><span class="number">00</span>);
|
||||||
|
pane.getChildren().add(imageView1);
|
||||||
|
|
||||||
|
ImageView imageView2 = <span class="literal">new</span> ImageView(image);
|
||||||
|
imageView2.setRotate(<span class="number">9</span><span class="number">0.0</span>);
|
||||||
|
pane.getChildren().add(imageView2);
|
||||||
|
|
||||||
|
<span class="comment">//Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">Flags</span><span class="string">"</span>); <span class="comment">// Set the stage title</span>
|
||||||
|
primaryStage.setScene(scene); <span class="comment">// Place the scene in the stage</span>
|
||||||
|
primaryStage.show(); <span class="comment">// Display the stage</span>
|
||||||
|
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||||
|
{
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,85 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ImageArray1.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray1.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Insets;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.image.ImageView;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.HBox;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ImageArray1 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
<span class="literal">final</span> String BASE_PATH = <span class="string">"</span><span class="string">image/flag</span><span class="string">"</span>;
|
||||||
|
ImageView[] images = <span class="literal">new</span> ImageView[] {
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">0.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">1.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">2.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">3.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">4.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">5.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">6.gif</span><span class="string">"</span>)
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="comment">// Create a pane to hold the image views</span>
|
||||||
|
Pane hb = <span class="literal">new</span> HBox(<span class="number">1</span><span class="number">0</span>);
|
||||||
|
hb.setPadding(<span class="literal">new</span> Insets(<span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>));
|
||||||
|
|
||||||
|
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">0</span>; i < <span class="number">7</span>; ++i) {
|
||||||
|
images[i].setFitWidth(<span class="number">1</span><span class="number">50</span>);
|
||||||
|
images[i].setFitHeight(<span class="number">1</span><span class="number">00</span>);
|
||||||
|
hb.getChildren().add(images[i]);
|
||||||
|
}
|
||||||
|
<span class="comment">// Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(hb);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">Flags</span><span class="string">"</span>); <span class="comment">// Set the stage title</span>
|
||||||
|
primaryStage.setScene(scene); <span class="comment">// Place the scene in the stage</span>
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,86 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ImageArray2.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray2.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Insets;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.image.ImageView;
|
||||||
|
<span class="comment">import</span> <span class="comment">javafx</span><span class="comment">.</span><span class="comment">scene</span><span class="comment">.</span><span class="comment">layout</span><span class="comment">.</span><span class="comment">HBox</span><span class="comment">;</span>
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.VBox;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ImageArray2 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
<span class="literal">final</span> String BASE_PATH = <span class="string">"</span><span class="string">image/flag</span><span class="string">"</span>;
|
||||||
|
ImageView[] images = <span class="literal">new</span> ImageView[] {
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">0.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">1.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">2.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">3.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">4.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">5.gif</span><span class="string">"</span>),
|
||||||
|
<span class="literal">new</span> ImageView(BASE_PATH+<span class="string">"</span><span class="string">6.gif</span><span class="string">"</span>)
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="comment">// Create a pane to hold the image views</span>
|
||||||
|
Pane vb = <span class="literal">new</span> VBox(<span class="number">1</span><span class="number">0</span>);
|
||||||
|
vb.setPadding(<span class="literal">new</span> Insets(<span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>));
|
||||||
|
|
||||||
|
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">0</span>; i < <span class="number">7</span>; ++i) {
|
||||||
|
images[i].setFitWidth(<span class="number">1</span><span class="number">50</span>);
|
||||||
|
images[i].setFitHeight(<span class="number">1</span><span class="number">00</span>);
|
||||||
|
vb.getChildren().add(images[i]);
|
||||||
|
}
|
||||||
|
<span class="comment">// Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(vb);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">Flags</span><span class="string">"</span>); <span class="comment">// Set the stage title</span>
|
||||||
|
primaryStage.setScene(scene); <span class="comment">// Place the scene in the stage</span>
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -5,21 +5,20 @@
|
|||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
<!--
|
<!--
|
||||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
.ST2 {color: #ffc66d}
|
.literal {color: #cc7832}
|
||||||
|
.ST2 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
.string {color: #6a8759}
|
.string {color: #6a8759}
|
||||||
.number {color: #6897bb}
|
.number {color: #6897bb}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.ST4 {color: #8a653b}
|
||||||
.comment {color: #808080}
|
.comment {color: #808080}
|
||||||
.whitespace {color: #505050}
|
.whitespace {color: #505050}
|
||||||
.ST4 {color: #9876aa; font-family: monospace; font-style: italic}
|
.ST3 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
.ST6 {color: #ffc66d; font-family: monospace; font-style: italic}
|
.ST5 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
|
||||||
.ST5 {color: #8a653b}
|
|
||||||
.ST0 {color: #287bde}
|
|
||||||
.literal {color: #cc7832}
|
|
||||||
.ST3 {font-family: monospace; font-style: italic}
|
|
||||||
-->
|
-->
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
@ -42,23 +41,23 @@ table {color: #888888; background-color: #313335; font-family: monospace}
|
|||||||
<span class="literal">import</span> style.ButtonStyle;
|
<span class="literal">import</span> style.ButtonStyle;
|
||||||
<span class="comment">/**</span>
|
<span class="comment">/**</span>
|
||||||
<span class="comment"> *</span>
|
<span class="comment"> *</span>
|
||||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
<span class="comment">*/</span>
|
<span class="comment">*/</span>
|
||||||
<span class="literal">public</span> <span class="literal">class</span> Lab2_FX2_F22_part1 <span class="literal">extends</span> Application {
|
<span class="literal">public</span> <span class="literal">class</span> Lab2_FX2_F22_part1 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
<span class="literal">public</span> <span class="literal">void</span> <span class="ST2">start</span>(Stage primaryStage)
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage)
|
||||||
{
|
{
|
||||||
String style = ButtonStyle.<span class="ST3">getStyle</span>();
|
String style = ButtonStyle.<span class="ST2">getStyle</span>();
|
||||||
Button btn = <span class="literal">new</span> Button();
|
Button btn = <span class="literal">new</span> Button();
|
||||||
btn.setStyle(style);
|
btn.setStyle(style);
|
||||||
btn.setText(<span class="string">"</span><span class="string">Say 'Hello World'</span><span class="string">"</span>);
|
btn.setText(<span class="string">"</span><span class="string">Say 'Hello World'</span><span class="string">"</span>);
|
||||||
btn.setOnAction(<span class="literal">new</span> EventHandler<ActionEvent>() {
|
btn.setOnAction(<span class="literal">new</span> EventHandler<ActionEvent>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
<span class="literal">public</span> <span class="literal">void</span> <span class="ST2">handle</span>(ActionEvent event)
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">handle</span>(ActionEvent event)
|
||||||
{
|
{
|
||||||
System.<span class="ST4">out</span>.println(<span class="string">"</span><span class="string">Hello World!</span><span class="string">"</span>);
|
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Hello World!</span><span class="string">"</span>);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
StackPane root = <span class="literal">new</span> StackPane();
|
StackPane root = <span class="literal">new</span> StackPane();
|
||||||
@ -72,11 +71,11 @@ table {color: #888888; background-color: #313335; font-family: monospace}
|
|||||||
}
|
}
|
||||||
|
|
||||||
<span class="comment">/**</span>
|
<span class="comment">/**</span>
|
||||||
<span class="comment"> * </span><span class="ST1">@param</span> <span class="ST5">args</span> <span class="comment">the</span> <span class="comment">command</span> <span class="comment">line</span> <span class="comment">arguments</span>
|
<span class="comment"> * </span><span class="comment">@param</span> <span class="ST4">args</span> <span class="comment">the</span> <span class="comment">command</span> <span class="comment">line</span> <span class="comment">arguments</span>
|
||||||
<span class="comment">*/</span>
|
<span class="comment">*/</span>
|
||||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST6">main</span>(String[] args)
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST5">main</span>(String[] args)
|
||||||
{
|
{
|
||||||
<span class="ST3">launch</span>(args);
|
<span class="ST2">launch</span>(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,83 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ShowGridPane1.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST4 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane1.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.geometry.HPos;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Insets;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Pos;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.Button;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.Label;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.TextField;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.GridPane;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ShowGridPane1 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override <span class="comment">// Override the start method in the Application class</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
<span class="comment">// Create a pane and set its properties</span>
|
||||||
|
GridPane pane = <span class="literal">new</span> GridPane();
|
||||||
|
pane.setAlignment(Pos.<span class="ST2">CENTER</span>);
|
||||||
|
pane.setPadding(<span class="literal">new</span> Insets(<span class="number">1</span><span class="number">1.5</span>, <span class="number">1</span><span class="number">2.5</span>, <span class="number">1</span><span class="number">3.5</span>, <span class="number">1</span><span class="number">4.5</span>));
|
||||||
|
pane.setHgap(<span class="number">5</span><span class="number">.5</span>);
|
||||||
|
pane.setVgap(<span class="number">5</span><span class="number">.5</span>);
|
||||||
|
|
||||||
|
<span class="comment">// Place nodes in the pane</span>
|
||||||
|
pane.add(<span class="literal">new</span> Label(<span class="string">"</span><span class="string">First Name:</span><span class="string">"</span>), <span class="number">0</span>, <span class="number">0</span>);
|
||||||
|
pane.add(<span class="literal">new</span> TextField(), <span class="number">1</span>, <span class="number">0</span>);
|
||||||
|
pane.add(<span class="literal">new</span> Label(<span class="string">"</span><span class="string">MI</span><span class="string">"</span>), <span class="number">0</span>, <span class="number">1</span>);
|
||||||
|
pane.add(<span class="literal">new</span> TextField(), <span class="number">1</span>, <span class="number">1</span>);
|
||||||
|
pane.add(<span class="literal">new</span> Label(<span class="string">"</span><span class="string">Last Name:</span><span class="string">"</span>), <span class="number">0</span>, <span class="number">2</span>);
|
||||||
|
pane.add(<span class="literal">new</span> TextField(), <span class="number">1</span>, <span class="number">2</span>);
|
||||||
|
Button button = <span class="literal">new</span> Button(<span class="string">"</span><span class="string">Add Name</span><span class="string">"</span>);
|
||||||
|
pane.add(button, <span class="number">1</span>, <span class="number">3</span>);
|
||||||
|
GridPane.<span class="ST3">setHalignment</span>(button, HPos.<span class="ST2">RIGHT</span>);
|
||||||
|
|
||||||
|
<span class="comment">// Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">ShowGridPane</span><span class="string">"</span>);
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST4">main</span>(String[] args) {
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,103 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ShowGridPane2.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST4 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowGridPane2.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.event.ActionEvent;
|
||||||
|
<span class="literal">import</span> javafx.event.EventHandler;
|
||||||
|
<span class="literal">import</span> javafx.geometry.HPos;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Insets;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Pos;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.Button;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.Label;
|
||||||
|
<span class="literal">import</span> javafx.scene.control.TextField;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.GridPane;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ShowGridPane2 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override <span class="comment">// Override the start method in the Application class</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
<span class="comment">// Create a pane and set its properties</span>
|
||||||
|
GridPane pane = <span class="literal">new</span> GridPane();
|
||||||
|
pane.setAlignment(Pos.<span class="ST2">CENTER</span>);
|
||||||
|
pane.setPadding(<span class="literal">new</span> Insets(<span class="number">1</span><span class="number">1.5</span>, <span class="number">1</span><span class="number">2.5</span>, <span class="number">1</span><span class="number">3.5</span>, <span class="number">1</span><span class="number">4.5</span>));
|
||||||
|
pane.setHgap(<span class="number">5</span><span class="number">.5</span>);
|
||||||
|
pane.setVgap(<span class="number">5</span><span class="number">.5</span>);
|
||||||
|
|
||||||
|
<span class="comment">// Place nodes in the pane</span>
|
||||||
|
pane.add(<span class="literal">new</span> Label(<span class="string">"</span><span class="string">First Name:</span><span class="string">"</span>), <span class="number">0</span>, <span class="number">0</span>);
|
||||||
|
TextField fName = <span class="literal">new</span> TextField();
|
||||||
|
pane.add(fName, <span class="number">1</span>, <span class="number">0</span>);
|
||||||
|
pane.add(<span class="literal">new</span> Label(<span class="string">"</span><span class="string">MI:</span><span class="string">"</span>), <span class="number">0</span>, <span class="number">1</span>);
|
||||||
|
TextField mInit = <span class="literal">new</span> TextField();
|
||||||
|
pane.add(mInit, <span class="number">1</span>, <span class="number">1</span>);
|
||||||
|
pane.add(<span class="literal">new</span> Label(<span class="string">"</span><span class="string">Last Name:</span><span class="string">"</span>), <span class="number">0</span>, <span class="number">2</span>);
|
||||||
|
TextField lName = <span class="literal">new</span> TextField();
|
||||||
|
pane.add(lName, <span class="number">1</span>, <span class="number">2</span>);
|
||||||
|
pane.add(<span class="literal">new</span> Label(<span class="string">"</span><span class="string">Gender, M/F/nb:</span><span class="string">"</span>), <span class="number">0</span>, <span class="number">3</span>);
|
||||||
|
TextField gender = <span class="literal">new</span> TextField();
|
||||||
|
gender.setMaxSize(<span class="number">4</span><span class="number">0</span>, <span class="number">2</span><span class="number">0</span>);
|
||||||
|
pane.add(gender, <span class="number">1</span>, <span class="number">3</span>);
|
||||||
|
Button button = <span class="literal">new</span> Button(<span class="string">"</span><span class="string">Add Person</span><span class="string">"</span>);
|
||||||
|
EventHandler eventHnadler = <span class="literal">new</span> EventHandler<ActionEvent>(){
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">handle</span>(ActionEvent t)
|
||||||
|
{
|
||||||
|
System.<span class="ST2">out</span>.println(<span class="string">"</span><span class="string">Added person:</span><span class="string">"</span>);
|
||||||
|
System.<span class="ST2">out</span>.println(fName.getText() + <span class="string">"</span> <span class="string">"</span> + mInit.getText() + <span class="string">"</span> <span class="string">"</span> + lName.getText());
|
||||||
|
System.<span class="ST2">out</span>.println(<span class="string">"</span><span class="string">Gender: </span><span class="string">"</span> + gender.getText());
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
button.setOnAction(eventHnadler);
|
||||||
|
pane.add(button, <span class="number">0</span>, <span class="number">4</span>);
|
||||||
|
GridPane.<span class="ST3">setHalignment</span>(button, HPos.<span class="ST2">LEFT</span>);
|
||||||
|
|
||||||
|
<span class="comment">// Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">ShowGridPane</span><span class="string">"</span>);
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST4">main</span>(String[] args) {
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,67 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ShowLine0.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine0.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.scene.shape.Line;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ShowLine0 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
Pane pane = <span class="literal">new</span> Pane();
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">ShowLine</span><span class="string">"</span>); <span class="comment">// Set the stage title</span>
|
||||||
|
primaryStage.setScene(scene); <span class="comment">// Place the scene in the stage</span>
|
||||||
|
|
||||||
|
Line line = <span class="literal">new</span> Line();
|
||||||
|
line.setStartX(<span class="number">0</span><span class="number">.0f</span>);
|
||||||
|
line.setStartY(<span class="number">0</span><span class="number">.0f</span>);
|
||||||
|
line.setEndX(<span class="number">1</span><span class="number">00.0f</span>);
|
||||||
|
line.setEndY(<span class="number">1</span><span class="number">00.0f</span>);
|
||||||
|
|
||||||
|
pane.getChildren().add(line);
|
||||||
|
primaryStage.show(); <span class="comment">//Display the stage</span>
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,80 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ShowLine1.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST4 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine1.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="comment">import</span> <span class="comment">javafx</span><span class="comment">.</span><span class="comment">scene</span><span class="comment">.</span><span class="comment">Parent</span><span class="comment">;</span>
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.scene.paint.Color;
|
||||||
|
<span class="literal">import</span> javafx.scene.shape.Line;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ShowLine1 <span class="literal">extends</span> Application{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(<span class="literal">new</span> LinePane1(), <span class="number">2</span><span class="number">00</span>, <span class="number">2</span><span class="number">00</span>);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">ShowLine</span><span class="string">"</span>); <span class="comment">// Set the stage title</span>
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
<span class="literal">class</span> LinePane1 <span class="literal">extends</span> Pane {
|
||||||
|
|
||||||
|
<span class="literal">public</span> LinePane1() {
|
||||||
|
Line line1 = <span class="literal">new</span> Line(<span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">1</span>, <span class="number">1</span><span class="number">1</span>);
|
||||||
|
line1.endXProperty().bind(widthProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line1.endYProperty().bind(heightProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line1.setStrokeWidth(<span class="number">5</span>);
|
||||||
|
line1.setStroke(Color.<span class="ST4">GREEN</span>);
|
||||||
|
<span class="literal">this</span>.getChildren().add(line1);
|
||||||
|
|
||||||
|
Line line2 = <span class="literal">new</span> Line(<span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">1</span>, <span class="number">1</span><span class="number">1</span>);
|
||||||
|
line2.startXProperty().bind(widthProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line2.endYProperty().bind(heightProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line2.setStrokeWidth(<span class="number">5</span>);
|
||||||
|
line2.setStroke(Color.<span class="ST4">GREEN</span>);
|
||||||
|
<span class="literal">this</span>.getChildren().add(line2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,90 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ShowLine2.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST4 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowLine2.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="comment">import</span> <span class="comment">javafx</span><span class="comment">.</span><span class="comment">scene</span><span class="comment">.</span><span class="comment">Parent</span><span class="comment">;</span>
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.scene.paint.Color;
|
||||||
|
<span class="literal">import</span> javafx.scene.shape.Line;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ShowLine2 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(<span class="literal">new</span> LinePane1(), <span class="number">2</span><span class="number">00</span>, <span class="number">2</span><span class="number">00</span>);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">ShowLine</span><span class="string">"</span>); <span class="comment">// Set the stage title</span>
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||||
|
<span class="ST3">launch</span>(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="literal">class</span> LinePane1 <span class="literal">extends</span> Pane {
|
||||||
|
|
||||||
|
<span class="literal">public</span> LinePane1() {
|
||||||
|
Line line1 = <span class="literal">new</span> Line(<span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">1</span>, <span class="number">1</span><span class="number">1</span>);
|
||||||
|
line1.endXProperty().bind(widthProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line1.endYProperty().bind(heightProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line1.setStrokeWidth(<span class="number">5</span>);
|
||||||
|
line1.setStroke(Color.<span class="ST4">GREEN</span>);
|
||||||
|
<span class="literal">this</span>.getChildren().add(line1);
|
||||||
|
|
||||||
|
Line line2 = <span class="literal">new</span> Line(<span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">1</span>, <span class="number">1</span><span class="number">1</span>);
|
||||||
|
line2.startXProperty().bind(widthProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line2.endYProperty().bind(heightProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line2.setStrokeWidth(<span class="number">5</span>);
|
||||||
|
line2.setStroke(Color.<span class="ST4">GREEN</span>);
|
||||||
|
<span class="literal">this</span>.getChildren().add(line2);
|
||||||
|
|
||||||
|
Line line3 = <span class="literal">new</span> Line(<span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>);
|
||||||
|
line3.startXProperty().bind(widthProperty().divide(<span class="number">2</span>));
|
||||||
|
line3.endXProperty().bind(widthProperty().divide(<span class="number">2</span>));
|
||||||
|
line3.endYProperty().bind(heightProperty().subtract(<span class="number">1</span><span class="number">0</span>));
|
||||||
|
line3.setStrokeWidth(<span class="number">1</span><span class="number">0</span>);
|
||||||
|
line3.setStroke(Color.<span class="ST4">RED</span>);
|
||||||
|
<span class="literal">this</span>.getChildren().add(line3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,83 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ShowText1.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST2 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.string {color: #6a8759}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST3 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST4 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowText1.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.geometry.Insets;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.scene.paint.Color;
|
||||||
|
<span class="literal">import</span> javafx.scene.text.Font;
|
||||||
|
<span class="literal">import</span> javafx.scene.text.FontPosture;
|
||||||
|
<span class="literal">import</span> javafx.scene.text.FontWeight;
|
||||||
|
<span class="literal">import</span> javafx.scene.text.Text;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> ShowText1 <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
<span class="comment">// Create a pane to hold the texts</span>
|
||||||
|
Pane pane = <span class="literal">new</span> Pane();
|
||||||
|
pane.setPadding(<span class="literal">new</span> Insets(<span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>));
|
||||||
|
Text text1 = <span class="literal">new</span> Text(<span class="number">4</span><span class="number">0</span>, <span class="number">4</span><span class="number">0</span>, <span class="string">"</span><span class="string">Java programming is bold and beautiful!</span><span class="string">"</span>);
|
||||||
|
|
||||||
|
text1.setFont(Font.<span class="ST2">font</span>(<span class="string">"</span><span class="string">Impact</span><span class="string">"</span>, FontWeight.<span class="ST3">BOLD</span>,
|
||||||
|
FontPosture.<span class="ST3">ITALIC</span>, <span class="number">3</span><span class="number">6</span>));
|
||||||
|
pane.getChildren().add(text1);
|
||||||
|
|
||||||
|
Text text2 = <span class="literal">new</span> Text(<span class="number">6</span><span class="number">0</span>, <span class="number">6</span><span class="number">0</span>, <span class="string">"</span><span class="string">Java Programming is fun</span><span class="literal">\n</span><span class="string">and Challenging!</span><span class="string">"</span>);
|
||||||
|
pane.getChildren().add(text2);
|
||||||
|
|
||||||
|
Text text3 = <span class="literal">new</span> Text(<span class="number">1</span><span class="number">0</span>, <span class="number">1</span><span class="number">00</span>, <span class="string">"</span><span class="string">C# Programming is not as beautiful as Java programming!</span><span class="literal">\n</span><span class="string"> Try it!</span><span class="string">"</span>);
|
||||||
|
text3.setFill(Color.<span class="ST3">RED</span>);
|
||||||
|
text3.setUnderline(<span class="literal">t</span><span class="literal">rue</span>);
|
||||||
|
text3.setStrikethrough(<span class="literal">t</span><span class="literal">rue</span>);
|
||||||
|
text3.rotateProperty().add(<span class="number">9</span><span class="number">0</span>);
|
||||||
|
pane.getChildren().add(text3);
|
||||||
|
|
||||||
|
<span class="comment">// Create a scene and place it in the stage</span>
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane);
|
||||||
|
primaryStage.setTitle(<span class="string">"</span><span class="string">ShowText</span><span class="string">"</span>); <span class="comment">// Set the stage title</span>
|
||||||
|
primaryStage.setScene(scene); <span class="comment">// Place the scene in the stage</span>
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST4">main</span>(String[] args) {
|
||||||
|
<span class="ST2">launch</span>(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>TestArc.java</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||||
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||||
|
.literal {color: #cc7832}
|
||||||
|
.ST4 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST0 {color: #287bde}
|
||||||
|
.number {color: #6897bb}
|
||||||
|
.ST1 {color: #ffc66d}
|
||||||
|
.comment {color: #808080}
|
||||||
|
.whitespace {color: #505050}
|
||||||
|
.ST2 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
.ST3 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/TestArc.java</td></tr></table>
|
||||||
|
<pre>
|
||||||
|
<span class="comment">/*</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||||
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||||
|
<span class="comment"> */</span>
|
||||||
|
<span class="literal">package</span> lab2_fx2_f22_part1;
|
||||||
|
|
||||||
|
<span class="literal">import</span> javafx.application.Application;
|
||||||
|
<span class="literal">import</span> javafx.scene.Scene;
|
||||||
|
<span class="literal">import</span> javafx.scene.layout.Pane;
|
||||||
|
<span class="literal">import</span> javafx.scene.shape.Arc;
|
||||||
|
<span class="literal">import</span> javafx.scene.shape.ArcType;
|
||||||
|
<span class="literal">import</span> javafx.stage.Stage;
|
||||||
|
|
||||||
|
<span class="comment">/**</span>
|
||||||
|
<span class="comment"> *</span>
|
||||||
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||||
|
<span class="comment">*/</span>
|
||||||
|
<span class="literal">public</span> <span class="literal">class</span> TestArc <span class="literal">extends</span> Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
|
||||||
|
Pane pane = <span class="literal">new</span> Pane();
|
||||||
|
|
||||||
|
Arc arc = <span class="literal">new</span> Arc();
|
||||||
|
arc.setCenterX(<span class="number">5</span><span class="number">0.0f</span>);
|
||||||
|
arc.setCenterY(<span class="number">5</span><span class="number">0.0f</span>);
|
||||||
|
arc.setRadiusX(<span class="number">2</span><span class="number">5.0f</span>);
|
||||||
|
arc.setRadiusY(<span class="number">2</span><span class="number">5.0f</span>);
|
||||||
|
arc.setStartAngle(<span class="number">4</span><span class="number">5.0f</span>);
|
||||||
|
arc.setLength(<span class="number">2</span><span class="number">70.0f</span>);
|
||||||
|
arc.setType(ArcType.<span class="ST2">ROUND</span>);
|
||||||
|
|
||||||
|
pane.getChildren().add(arc);
|
||||||
|
Scene scene = <span class="literal">new</span> Scene(pane, <span class="number">4</span><span class="number">00</span>, <span class="number">3</span><span class="number">00</span>);
|
||||||
|
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST3">main</span>(String[] args) {
|
||||||
|
<span class="ST4">launch</span>(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</pre></body>
|
||||||
|
</html>
|
@ -120,43 +120,7 @@ is divided into following sections:
|
|||||||
<property name="module.name" value=""/>
|
<property name="module.name" value=""/>
|
||||||
</target>
|
</target>
|
||||||
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
|
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
|
||||||
<j2seproject1:property name="platform.home" value="platforms.${platform.active}.home"/>
|
<property name="platform.java" value="${java.home}/bin/java"/>
|
||||||
<j2seproject1:property name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/>
|
|
||||||
<j2seproject1:property name="platform.compiler" value="platforms.${platform.active}.compile"/>
|
|
||||||
<j2seproject1:property name="platform.javac.tmp" value="platforms.${platform.active}.javac"/>
|
|
||||||
<condition property="platform.javac" value="${platform.home}/bin/javac">
|
|
||||||
<equals arg1="${platform.javac.tmp}" arg2="$${platforms.${platform.active}.javac}"/>
|
|
||||||
</condition>
|
|
||||||
<property name="platform.javac" value="${platform.javac.tmp}"/>
|
|
||||||
<j2seproject1:property name="platform.java.tmp" value="platforms.${platform.active}.java"/>
|
|
||||||
<condition property="platform.java" value="${platform.home}/bin/java">
|
|
||||||
<equals arg1="${platform.java.tmp}" arg2="$${platforms.${platform.active}.java}"/>
|
|
||||||
</condition>
|
|
||||||
<property name="platform.java" value="${platform.java.tmp}"/>
|
|
||||||
<j2seproject1:property name="platform.javadoc.tmp" value="platforms.${platform.active}.javadoc"/>
|
|
||||||
<condition property="platform.javadoc" value="${platform.home}/bin/javadoc">
|
|
||||||
<equals arg1="${platform.javadoc.tmp}" arg2="$${platforms.${platform.active}.javadoc}"/>
|
|
||||||
</condition>
|
|
||||||
<property name="platform.javadoc" value="${platform.javadoc.tmp}"/>
|
|
||||||
<condition property="platform.invalid" value="true">
|
|
||||||
<or>
|
|
||||||
<contains string="${platform.javac}" substring="$${platforms."/>
|
|
||||||
<contains string="${platform.java}" substring="$${platforms."/>
|
|
||||||
<contains string="${platform.javadoc}" substring="$${platforms."/>
|
|
||||||
</or>
|
|
||||||
</condition>
|
|
||||||
<fail unless="platform.home">Must set platform.home</fail>
|
|
||||||
<fail unless="platform.bootcp">Must set platform.bootcp</fail>
|
|
||||||
<fail unless="platform.java">Must set platform.java</fail>
|
|
||||||
<fail unless="platform.javac">Must set platform.javac</fail>
|
|
||||||
<fail if="platform.invalid">
|
|
||||||
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)
|
|
||||||
</fail>
|
|
||||||
<available file="${manifest.file}" property="manifest.available"/>
|
<available file="${manifest.file}" property="manifest.available"/>
|
||||||
<condition property="splashscreen.available">
|
<condition property="splashscreen.available">
|
||||||
<and>
|
<and>
|
||||||
@ -279,6 +243,20 @@ is divided into following sections:
|
|||||||
<condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
|
<condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
|
||||||
<isset property="profile.available"/>
|
<isset property="profile.available"/>
|
||||||
</condition>
|
</condition>
|
||||||
|
<condition else="false" property="jdkBug6558476">
|
||||||
|
<and>
|
||||||
|
<matches pattern="1\.[56]" string="${java.specification.version}"/>
|
||||||
|
<not>
|
||||||
|
<os family="unix"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition else="false" property="javac.fork">
|
||||||
|
<or>
|
||||||
|
<istrue value="${jdkBug6558476}"/>
|
||||||
|
<istrue value="${javac.external.vm}"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
<property name="jar.index" value="false"/>
|
<property name="jar.index" value="false"/>
|
||||||
<property name="jar.index.metainf" value="${jar.index}"/>
|
<property name="jar.index.metainf" value="${jar.index}"/>
|
||||||
<property name="copylibs.rebase" value="true"/>
|
<property name="copylibs.rebase" value="true"/>
|
||||||
@ -366,7 +344,7 @@ is divided into following sections:
|
|||||||
</path>
|
</path>
|
||||||
</resourcecount>
|
</resourcecount>
|
||||||
</condition>
|
</condition>
|
||||||
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
||||||
<src>
|
<src>
|
||||||
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
||||||
<include name="*"/>
|
<include name="*"/>
|
||||||
@ -417,7 +395,7 @@ is divided into following sections:
|
|||||||
<property location="${build.dir}/empty" name="empty.dir"/>
|
<property location="${build.dir}/empty" name="empty.dir"/>
|
||||||
<mkdir dir="${empty.dir}"/>
|
<mkdir dir="${empty.dir}"/>
|
||||||
<mkdir dir="@{apgeneratedsrcdir}"/>
|
<mkdir dir="@{apgeneratedsrcdir}"/>
|
||||||
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
||||||
<src>
|
<src>
|
||||||
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
||||||
<include name="*"/>
|
<include name="*"/>
|
||||||
@ -459,7 +437,7 @@ is divided into following sections:
|
|||||||
<sequential>
|
<sequential>
|
||||||
<property location="${build.dir}/empty" name="empty.dir"/>
|
<property location="${build.dir}/empty" name="empty.dir"/>
|
||||||
<mkdir dir="${empty.dir}"/>
|
<mkdir dir="${empty.dir}"/>
|
||||||
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
||||||
<src>
|
<src>
|
||||||
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
||||||
<include name="*"/>
|
<include name="*"/>
|
||||||
@ -538,7 +516,7 @@ is divided into following sections:
|
|||||||
<element name="customizePrototype" optional="true"/>
|
<element name="customizePrototype" optional="true"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<property name="junit.forkmode" value="perTest"/>
|
<property name="junit.forkmode" value="perTest"/>
|
||||||
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
|
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
|
||||||
<syspropertyset>
|
<syspropertyset>
|
||||||
<propertyref prefix="test-sys-prop."/>
|
<propertyref prefix="test-sys-prop."/>
|
||||||
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
||||||
@ -566,7 +544,7 @@ is divided into following sections:
|
|||||||
<element name="customizePrototype" optional="true"/>
|
<element name="customizePrototype" optional="true"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<property name="junit.forkmode" value="perTest"/>
|
<property name="junit.forkmode" value="perTest"/>
|
||||||
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
|
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
|
||||||
<syspropertyset>
|
<syspropertyset>
|
||||||
<propertyref prefix="test-sys-prop."/>
|
<propertyref prefix="test-sys-prop."/>
|
||||||
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
||||||
@ -642,7 +620,7 @@ is divided into following sections:
|
|||||||
</fileset>
|
</fileset>
|
||||||
</union>
|
</union>
|
||||||
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
|
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
|
||||||
<testng classfilesetref="test.set" failureProperty="tests.failed" jvm="${platform.java}" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="lab2_FX2_F22_part1" testname="TestNG tests" workingDir="${work.dir}">
|
<testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="lab2_FX2_F22_part1" testname="TestNG tests" workingDir="${work.dir}">
|
||||||
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
|
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
|
||||||
<propertyset>
|
<propertyset>
|
||||||
<propertyref prefix="test-sys-prop."/>
|
<propertyref prefix="test-sys-prop."/>
|
||||||
@ -873,9 +851,6 @@ is divided into following sections:
|
|||||||
<classpath>
|
<classpath>
|
||||||
<path path="@{classpath}"/>
|
<path path="@{classpath}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
<bootclasspath>
|
|
||||||
<path path="${platform.bootcp}"/>
|
|
||||||
</bootclasspath>
|
|
||||||
</nbjpdastart>
|
</nbjpdastart>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
@ -925,7 +900,7 @@ is divided into following sections:
|
|||||||
<attribute default="jvm" name="jvm"/>
|
<attribute default="jvm" name="jvm"/>
|
||||||
<element name="customize" optional="true"/>
|
<element name="customize" optional="true"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}" module="@{modulename}">
|
<java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
|
||||||
<classpath>
|
<classpath>
|
||||||
<path path="@{classpath}"/>
|
<path path="@{classpath}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
@ -959,7 +934,7 @@ is divided into following sections:
|
|||||||
<attribute default="jvm" name="jvm"/>
|
<attribute default="jvm" name="jvm"/>
|
||||||
<element name="customize" optional="true"/>
|
<element name="customize" optional="true"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}">
|
<java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
|
||||||
<classpath>
|
<classpath>
|
||||||
<path path="@{classpath}"/>
|
<path path="@{classpath}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
@ -991,7 +966,7 @@ is divided into following sections:
|
|||||||
<attribute default="jvm" name="jvm"/>
|
<attribute default="jvm" name="jvm"/>
|
||||||
<element name="customize" optional="true"/>
|
<element name="customize" optional="true"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}">
|
<java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
|
||||||
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
||||||
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
|
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
|
||||||
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
|
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
|
||||||
@ -1225,7 +1200,7 @@ is divided into following sections:
|
|||||||
<j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
|
<j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
|
||||||
<echo level="info">To run this application from the command line without Ant, try:</echo>
|
<echo level="info">To run this application from the command line without Ant, try:</echo>
|
||||||
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
||||||
<echo level="info">${platform.java} -jar "${dist.jar.resolved}"</echo>
|
<echo level="info">java -jar "${dist.jar.resolved}"</echo>
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
|
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
|
||||||
<j2seproject1:jar manifest="${tmp.manifest.file}"/>
|
<j2seproject1:jar manifest="${tmp.manifest.file}"/>
|
||||||
@ -1327,8 +1302,8 @@ is divided into following sections:
|
|||||||
<isset property="main.class.available"/>
|
<isset property="main.class.available"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="platform.jlink" value="${platform.home}/bin/jlink"/>
|
<property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
|
||||||
<property name="jlink.systemmodules.internal" value="${platform.home}/jmods"/>
|
<property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
|
||||||
<exec executable="${platform.jlink}">
|
<exec executable="${platform.jlink}">
|
||||||
<arg value="--module-path"/>
|
<arg value="--module-path"/>
|
||||||
<arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
|
<arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
|
||||||
@ -1521,19 +1496,16 @@ is divided into following sections:
|
|||||||
</not>
|
</not>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<exec executable="${platform.java}" failonerror="false" outputproperty="platform.version.output">
|
|
||||||
<arg value="-version"/>
|
|
||||||
</exec>
|
|
||||||
<condition else="" property="bug5101868workaround" value="*.java">
|
<condition else="" property="bug5101868workaround" value="*.java">
|
||||||
<matches multiline="true" pattern="1\.[56](\..*)?" string="${platform.version.output}"/>
|
<matches pattern="1\.[56](\..*)?" string="${java.version}"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
|
<condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
|
||||||
<and>
|
<and>
|
||||||
<isset property="javadoc.html5"/>
|
<isset property="javadoc.html5"/>
|
||||||
<available file="${platform.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
|
<available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" executable="${platform.javadoc}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
<javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||||
<classpath>
|
<classpath>
|
||||||
<path path="${javac.classpath}"/>
|
<path path="${javac.classpath}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
@ -3,6 +3,6 @@ build.xml.script.CRC32=f9afcb88
|
|||||||
build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48
|
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.
|
# 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.
|
# 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.data.CRC32=068e52b6
|
||||||
nbproject/build-impl.xml.script.CRC32=529e3864
|
nbproject/build-impl.xml.script.CRC32=02ccde00
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48
|
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48
|
||||||
|
@ -71,11 +71,16 @@ javadoc.version=false
|
|||||||
javadoc.windowtitle=
|
javadoc.windowtitle=
|
||||||
javafx.application.implementation.version=1.0
|
javafx.application.implementation.version=1.0
|
||||||
javafx.binarycss=false
|
javafx.binarycss=false
|
||||||
|
javafx.deploy.adddesktopshortcut=false
|
||||||
|
javafx.deploy.addstartmenushortcut=false
|
||||||
javafx.deploy.allowoffline=true
|
javafx.deploy.allowoffline=true
|
||||||
# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
|
# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
|
||||||
javafx.deploy.backgroundupdate=false
|
javafx.deploy.backgroundupdate=false
|
||||||
|
javafx.deploy.disable.proxy=false
|
||||||
javafx.deploy.embedJNLP=true
|
javafx.deploy.embedJNLP=true
|
||||||
javafx.deploy.includeDT=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)
|
# Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs)
|
||||||
javafx.disable.concurrent.runs=false
|
javafx.disable.concurrent.runs=false
|
||||||
# Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project
|
# 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.rebase.libs=false
|
||||||
javafx.run.height=600
|
javafx.run.height=600
|
||||||
javafx.run.width=800
|
javafx.run.width=800
|
||||||
|
javafx.signing.blob=false
|
||||||
|
javafx.signing.enabled=false
|
||||||
|
javafx.signing.type=notsigned
|
||||||
jlink.launcher=false
|
jlink.launcher=false
|
||||||
jlink.launcher.name=lab2_FX2_F22_part1
|
jlink.launcher.name=lab2_FX2_F22_part1
|
||||||
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
|
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
|
||||||
@ -109,9 +117,9 @@ manifest.custom.permissions=
|
|||||||
manifest.file=manifest.mf
|
manifest.file=manifest.mf
|
||||||
meta.inf.dir=${src.dir}/META-INF
|
meta.inf.dir=${src.dir}/META-INF
|
||||||
mkdist.disabled=false
|
mkdist.disabled=false
|
||||||
platform.active=JDK_1.8
|
native.bundling.enabled=false
|
||||||
|
platform.active=default_platform
|
||||||
run.classpath=\
|
run.classpath=\
|
||||||
${dist.jar}:\
|
|
||||||
${javac.classpath}:\
|
${javac.classpath}:\
|
||||||
${build.classes.dir}
|
${build.classes.dir}
|
||||||
run.modulepath=\
|
run.modulepath=\
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
</buildExtensions>
|
</buildExtensions>
|
||||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
<name>lab2_FX2_F22_part1</name>
|
<name>lab2_FX2_F22_part1</name>
|
||||||
<explicit-platform explicit-source-supported="true"/>
|
|
||||||
<source-roots>
|
<source-roots>
|
||||||
<root id="src.dir"/>
|
<root id="src.dir"/>
|
||||||
</source-roots>
|
</source-roots>
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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<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);
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB |
BIN
Semester 3/ZIPs/Lab2_FX2_F22_part2-CalebFontenot.zip
Normal file
BIN
Semester 3/ZIPs/Lab2_FX2_F22_part2-CalebFontenot.zip
Normal file
Binary file not shown.
BIN
java8-openjfx-8.u202-9-x86_64.pkg.tar.zst
Normal file
BIN
java8-openjfx-8.u202-9-x86_64.pkg.tar.zst
Normal file
Binary file not shown.
BIN
java8-openjfx-doc-8.u202-9-x86_64.pkg.tar.zst
Normal file
BIN
java8-openjfx-doc-8.u202-9-x86_64.pkg.tar.zst
Normal file
Binary file not shown.
BIN
java8-openjfx-src-8.u202-9-x86_64.pkg.tar.zst
Normal file
BIN
java8-openjfx-src-8.u202-9-x86_64.pkg.tar.zst
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user