Skip to content

Commit a8567a1

Browse files
committed
[*] Update comments
1 parent a297cd5 commit a8567a1

File tree

5 files changed

+349
-349
lines changed

5 files changed

+349
-349
lines changed

week_02/assignment_required/output/Assignment2Application1/src/assignment2application1/Assignment2Application1.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void start(Stage firstStage) {
4040

4141
firstStage.setTitle("Assignment2Application1");
4242

43-
// Load images in a list
43+
// Store images in a list
4444
List<ImageView> imagesList = new ArrayList<>();
4545

4646
for (int i = 0; i < 4; i++) {
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
1-
/*
2-
* Copyright 2019 George Tzikas <[email protected]>
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
package assignment2application2;
17-
18-
import java.util.ArrayList;
19-
import java.util.List;
20-
import java.util.Random;
21-
import javafx.application.Application;
22-
import javafx.geometry.Insets;
23-
import javafx.geometry.Pos;
24-
import javafx.scene.Scene;
25-
import javafx.scene.image.ImageView;
26-
import javafx.scene.layout.FlowPane;
27-
import javafx.stage.Stage;
28-
29-
/**
30-
*
31-
* @author tzikas97
32-
*/
33-
public class Assignment2Application2 extends Application {
34-
35-
/**
36-
*
37-
* @param firstStage The application's first stage
38-
*/
39-
@Override
40-
public void start(Stage firstStage) {
41-
42-
firstStage.setTitle("Assignment2Application2");
43-
44-
// Load images in a list
45-
List<ImageView> imagesList = new ArrayList<>();
46-
47-
Random rand = new Random();
48-
49-
for (int i = 0; i < 3; i++) {
50-
imagesList.add(new ImageView("res/img/" + rand.nextInt(53) + ".png"));
51-
}
52-
53-
FlowPane pane = new FlowPane();
54-
55-
// Layout options
56-
pane.setPadding(new Insets(10, 10, 10, 10));
57-
pane.setVgap(10);
58-
pane.setHgap(10);
59-
pane.setAlignment(Pos.CENTER);
60-
61-
// Add images to pane
62-
pane.getChildren().addAll(imagesList);
63-
64-
Scene scene = new Scene(pane, 400, 200);
65-
66-
firstStage.setScene(scene);
67-
firstStage.show();
68-
}
69-
70-
/**
71-
*
72-
* @param args The command line arguments
73-
*/
74-
public static void main(String[] args) {
75-
Application.launch(args);
76-
}
77-
78-
}
1+
/*
2+
* Copyright 2019 George Tzikas <[email protected]>
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package assignment2application2;
17+
18+
import java.util.ArrayList;
19+
import java.util.List;
20+
import java.util.Random;
21+
import javafx.application.Application;
22+
import javafx.geometry.Insets;
23+
import javafx.geometry.Pos;
24+
import javafx.scene.Scene;
25+
import javafx.scene.image.ImageView;
26+
import javafx.scene.layout.FlowPane;
27+
import javafx.stage.Stage;
28+
29+
/**
30+
*
31+
* @author tzikas97
32+
*/
33+
public class Assignment2Application2 extends Application {
34+
35+
/**
36+
*
37+
* @param firstStage The application's first stage
38+
*/
39+
@Override
40+
public void start(Stage firstStage) {
41+
42+
firstStage.setTitle("Assignment2Application2");
43+
44+
// Store images in a list
45+
List<ImageView> imagesList = new ArrayList<>();
46+
47+
Random rand = new Random();
48+
49+
for (int i = 0; i < 3; i++) {
50+
imagesList.add(new ImageView("res/img/" + rand.nextInt(53) + ".png"));
51+
}
52+
53+
FlowPane pane = new FlowPane();
54+
55+
// Layout options
56+
pane.setPadding(new Insets(10, 10, 10, 10));
57+
pane.setVgap(10);
58+
pane.setHgap(10);
59+
pane.setAlignment(Pos.CENTER);
60+
61+
// Add images to pane
62+
pane.getChildren().addAll(imagesList);
63+
64+
Scene scene = new Scene(pane, 400, 200);
65+
66+
firstStage.setScene(scene);
67+
firstStage.show();
68+
}
69+
70+
/**
71+
*
72+
* @param args The command line arguments
73+
*/
74+
public static void main(String[] args) {
75+
Application.launch(args);
76+
}
77+
78+
}
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,95 @@
1-
/*
2-
* Copyright 2019 George Tzikas <[email protected]>
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
package assignment2application4;
17-
18-
import java.util.ArrayList;
19-
import java.util.List;
20-
import javafx.application.Application;
21-
import javafx.geometry.HPos;
22-
import javafx.geometry.Insets;
23-
import javafx.geometry.Pos;
24-
import javafx.scene.Scene;
25-
import javafx.scene.control.Button;
26-
import javafx.scene.control.Label;
27-
import javafx.scene.control.TextField;
28-
import javafx.scene.layout.GridPane;
29-
import javafx.stage.Stage;
30-
31-
/**
32-
*
33-
* @author tzikas97
34-
*/
35-
public class Assignment2Application4 extends Application {
36-
37-
/**
38-
*
39-
* @param firstStage The application's first stage
40-
*/
41-
@Override
42-
public void start(Stage firstStage) {
43-
44-
firstStage.setTitle("Assignment2Application4");
45-
46-
// Load labels in a list
47-
List<Label> labelsList = new ArrayList<>();
48-
49-
// Load textfields in a list
50-
List<TextField> textFieldsList = new ArrayList<>();
51-
52-
labelsList.add(new Label("First Name:"));
53-
labelsList.add(new Label("Initials:"));
54-
labelsList.add(new Label("Last Name:"));
55-
56-
for (int i = 0; i < 3; i++) {
57-
textFieldsList.add(new TextField());
58-
}
59-
textFieldsList.get(0).setPromptText("Μικρό όνομα");
60-
textFieldsList.get(1).setPromptText("Αρχικά (Mr/Mrs/Miss)");
61-
textFieldsList.get(2).setPromptText("Επώνυμο");
62-
63-
Button submitButton = new Button("Submit");
64-
65-
GridPane pane = new GridPane();
66-
67-
// Layout options
68-
pane.setPadding(new Insets(10, 10, 10, 10));
69-
pane.setVgap(10);
70-
pane.setHgap(10);
71-
pane.setAlignment(Pos.CENTER);
72-
GridPane.setHalignment(submitButton, HPos.RIGHT);
73-
74-
for (int i = 0; i < 3; i++) {
75-
pane.add(labelsList.get(i), 0, i);
76-
pane.add(textFieldsList.get(i), 1, i);
77-
}
78-
79-
pane.add(submitButton, 1, 3);
80-
81-
Scene scene = new Scene(pane, 350, 350);
82-
83-
firstStage.setScene(scene);
84-
firstStage.show();
85-
}
86-
87-
/**
88-
*
89-
* @param args The command line arguments
90-
*/
91-
public static void main(String[] args) {
92-
Application.launch(args);
93-
}
94-
95-
}
1+
/*
2+
* Copyright 2019 George Tzikas <[email protected]>
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package assignment2application4;
17+
18+
import java.util.ArrayList;
19+
import java.util.List;
20+
import javafx.application.Application;
21+
import javafx.geometry.HPos;
22+
import javafx.geometry.Insets;
23+
import javafx.geometry.Pos;
24+
import javafx.scene.Scene;
25+
import javafx.scene.control.Button;
26+
import javafx.scene.control.Label;
27+
import javafx.scene.control.TextField;
28+
import javafx.scene.layout.GridPane;
29+
import javafx.stage.Stage;
30+
31+
/**
32+
*
33+
* @author tzikas97
34+
*/
35+
public class Assignment2Application4 extends Application {
36+
37+
/**
38+
*
39+
* @param firstStage The application's first stage
40+
*/
41+
@Override
42+
public void start(Stage firstStage) {
43+
44+
firstStage.setTitle("Assignment2Application4");
45+
46+
// Store labels in a list
47+
List<Label> labelsList = new ArrayList<>();
48+
49+
// Store textfields in a list
50+
List<TextField> textFieldsList = new ArrayList<>();
51+
52+
labelsList.add(new Label("First Name:"));
53+
labelsList.add(new Label("Initials:"));
54+
labelsList.add(new Label("Last Name:"));
55+
56+
for (int i = 0; i < 3; i++) {
57+
textFieldsList.add(new TextField());
58+
}
59+
textFieldsList.get(0).setPromptText("Μικρό όνομα");
60+
textFieldsList.get(1).setPromptText("Αρχικά (Mr/Mrs/Miss)");
61+
textFieldsList.get(2).setPromptText("Επώνυμο");
62+
63+
Button submitButton = new Button("Submit");
64+
65+
GridPane pane = new GridPane();
66+
67+
// Layout options
68+
pane.setPadding(new Insets(10, 10, 10, 10));
69+
pane.setVgap(10);
70+
pane.setHgap(10);
71+
pane.setAlignment(Pos.CENTER);
72+
GridPane.setHalignment(submitButton, HPos.RIGHT);
73+
74+
for (int i = 0; i < 3; i++) {
75+
pane.add(labelsList.get(i), 0, i);
76+
pane.add(textFieldsList.get(i), 1, i);
77+
}
78+
79+
pane.add(submitButton, 1, 3);
80+
81+
Scene scene = new Scene(pane, 350, 350);
82+
83+
firstStage.setScene(scene);
84+
firstStage.show();
85+
}
86+
87+
/**
88+
*
89+
* @param args The command line arguments
90+
*/
91+
public static void main(String[] args) {
92+
Application.launch(args);
93+
}
94+
95+
}

0 commit comments

Comments
 (0)