File tree Expand file tree Collapse file tree 3 files changed +96
-0
lines changed
Java Programming Principles 2/Homework/3. Unit Three/2. Algorithm Workbench Expand file tree Collapse file tree 3 files changed +96
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * This program was written by Kyle Martin on 7/25/2021 for Java Programming Principles 2 during Summer Session 2
3+ * at Southwestern College, Kansas.
4+ *
5+ * IMPORTANT: Normally I would not place a bunch of comments in my code describing what my code is doing as I like to
6+ * have code that is written in a manner to be understandable while reading it. Though, do to the grading rubric I will
7+ * explain my code.
8+ *
9+ * This program was created to add labels to an HBox element of JavaFX.
10+ * See Chapter 12 Algorithm Workbench Question 1.
11+ */
12+ import javafx .application .Application ;
13+ import javafx .scene .Scene ;
14+ import javafx .scene .control .Label ;
15+ import javafx .scene .layout .HBox ;
16+ import javafx .stage .Stage ;
17+
18+ public class QuestionOne extends Application {
19+ public static void main (String [] args ) {
20+ launch (args );
21+ }
22+
23+ @ Override
24+ public void start (Stage stage ) throws Exception {
25+ Label label1 = new Label ("One" );
26+ Label label2 = new Label ("Two" );
27+ Label label3 = new Label ("Three" );
28+
29+ HBox hbox = new HBox (label1 , label2 , label3 );
30+ Scene scene = new Scene (hbox );
31+ stage .setScene (scene );
32+ stage .setTitle ("Ch 12. Algorithm Workbench - Q1" );
33+ stage .show ();
34+ }
35+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * This program was written by Kyle Martin on 7/25/2021 for Java Programming Principles 2 during Summer Session 2
3+ * at Southwestern College, Kansas.
4+ *
5+ * IMPORTANT: Normally I would not place a bunch of comments in my code describing what my code is doing as I like to
6+ * have code that is written in a manner to be understandable while reading it. Though, do to the grading rubric I will
7+ * explain my code.
8+ *
9+ * This program was created to show how to set width and height elements of JavaFX.
10+ * See Chapter 12 Algorithm Workbench Question 2.
11+ */
12+ import javafx .application .Application ;
13+ import javafx .scene .Scene ;
14+ import javafx .scene .layout .HBox ;
15+ import javafx .stage .Stage ;
16+
17+ public class QuestionTwo extends Application {
18+ public static void main (String [] args ) {
19+ launch (args );
20+ }
21+
22+ @ Override
23+ public void start (Stage stage ) throws Exception {
24+ HBox hBox = new HBox ();
25+ Scene scene = new Scene (hBox );
26+ stage .setScene (scene );
27+ stage .setWidth (300 );
28+ stage .setHeight (200 );
29+ stage .setTitle ("Ch. 12 Algorithm Workbench - Q2" );
30+ stage .show ();
31+ }
32+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * This program was written by Kyle Martin on 7/25/2021 for Java Programming Principles 2 during Summer Session 2
3+ * at Southwestern College, Kansas.
4+ *
5+ * IMPORTANT: Normally I would not place a bunch of comments in my code describing what my code is doing as I like to
6+ * have code that is written in a manner to be understandable while reading it. Though, do to the grading rubric I will
7+ * explain my code.
8+ *
9+ * This program was created to add a scene element to a stage in JavaFX.
10+ * See Chapter 12 Algorithm Workbench Question 1.
11+ */
12+ import javafx .application .Application ;
13+ import javafx .scene .Scene ;
14+ import javafx .scene .layout .HBox ;
15+ import javafx .stage .Stage ;
16+
17+ public class QuestionThree extends Application {
18+ public static void main (String [] args ) {
19+ launch (args );
20+ }
21+
22+ @ Override
23+ public void start (Stage primaryStage ) {
24+ HBox hBox = new HBox (); // Sorta required for making a Scene
25+ Scene scene = new Scene (hBox );
26+ primaryStage .setScene (scene ); // Adds scene to stage
27+ primaryStage .show ();
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments