File tree Expand file tree Collapse file tree 5 files changed +149
-0
lines changed
Java Programming Principles 2/Homework/3. Unit Three/1. Find the Errors Ch. 12 Expand file tree Collapse file tree 5 files changed +149
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * This program was written by Kyle Martin on 7/22/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 fix a error in sudo code
10
+ * See Chapter 12 Find the Error Question 1.
11
+ */
12
+
13
+ import javafx .application .Application ;
14
+ import javafx .stage .Stage ;
15
+
16
+ public class QuestionOne extends Application {
17
+ @ Override
18
+ public void start (Stage primaryStage ) // Changed Scene to Stage
19
+ {
20
+ primaryStage .show (); // Changed Scene to Stage
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * This program was written by Kyle Martin on 7/22/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 fix a error in sudo code
10
+ * See Chapter 12 Find the Error Question 2.
11
+ */
12
+
13
+ import javafx .application .Application ;
14
+ import javafx .scene .Scene ;
15
+ import javafx .scene .control .Label ;
16
+ import javafx .scene .layout .HBox ;
17
+ import javafx .stage .Stage ;
18
+
19
+ public class QuestionTwo extends Application {
20
+ public static void main (String [] args ) {
21
+ launch (args );
22
+ }
23
+
24
+ @ Override
25
+ public void start (Stage stage ) throws Exception {
26
+ Label messageLabel = new Label ("Hello World" );
27
+ HBox hbox = new HBox (messageLabel ); // Added variable to hbox
28
+ //hbox.add(messageLabel); removed line of code
29
+ Scene scene = new Scene (hbox ); // added for scene not apart of exercise
30
+ stage .setScene (scene ); // added for scene not apart of exercise
31
+ stage .setTitle ("Find the Error 2 Chapter 12" ); // added for scene not apart of exercise
32
+ stage .show (); // added for scene not apart of exercise
33
+ }
34
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * This program was written by Kyle Martin on 7/22/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 fix a error in sudo code
10
+ * See Chapter 12 Find the Error Question 3.
11
+ */
12
+
13
+ import javafx .application .Application ;
14
+ import javafx .geometry .Pos ;
15
+ import javafx .scene .Scene ;
16
+ import javafx .scene .control .Label ;
17
+ import javafx .scene .layout .HBox ;
18
+ import javafx .stage .Stage ;
19
+
20
+ public class QuestionThree extends Application {
21
+ public static void main (String [] args ) {
22
+ launch (args );
23
+ }
24
+
25
+ @ Override
26
+ public void start (Stage stage ) throws Exception {
27
+ Label messageLabel = new Label ("Hello World" ); // added for scene not apart of exercise
28
+ HBox hbox = new HBox (messageLabel ); // added for scene not apart of exercise
29
+ hbox .setAlignment (Pos .CENTER ); // Added Pos. in front
30
+ Scene scene = new Scene (hbox ); // added for scene not apart of exercise
31
+ stage .setScene (scene ); // added for scene not apart of exercise
32
+ stage .setTitle ("Find the Error 3 Chapter 12" ); // added for scene not apart of exercise
33
+ stage .show (); // added for scene not apart of exercise
34
+ }
35
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * This program was written by Kyle Martin on 7/22/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 fix a error in sudo code
10
+ * See Chapter 12 Find the Error Question 4.
11
+ */
12
+
13
+ import javafx .application .Application ;
14
+ import javafx .scene .image .Image ;
15
+ import javafx .scene .image .ImageView ;
16
+ import javafx .stage .Stage ;
17
+
18
+ public class QuestionFour 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
+ Image image = new Image ("file:C:\\ Images\\ HotAirBalloon.png" ); // Added for ImageView
26
+ ImageView view = new ImageView (image ); // Changed from path to image variable
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * This program was written by Kyle Martin on 7/22/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 fix a error in sudo code
10
+ * See Chapter 12 Find the Error Question 5.
11
+ */
12
+
13
+ import javafx .application .Application ;
14
+ import javafx .scene .image .Image ;
15
+ import javafx .scene .image .ImageView ;
16
+ import javafx .stage .Stage ;
17
+
18
+ public class QuestionFive 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
+ Image image = new Image ("file:HotAirBalloon.png" ); // added for context not apart of exercise
26
+ ImageView myImageView = new ImageView (image ); // added for context not apart of exercise
27
+ myImageView .setFitWidth (100 ); // corrected error to setFitWidth
28
+ myImageView .setFitHeight (100 ); // corrected error to setFitHeight
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments