Skip to content

Commit 5861ff3

Browse files
authored
Fixed time label (#5)
1 parent 1d941e9 commit 5861ff3

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

lab_02/lab_02.iml

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module type="JAVA_MODULE" version="4" />
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11">
4+
<output url="file://$MODULE_DIR$/target/classes" />
5+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8+
<excludeFolder url="file://$MODULE_DIR$/target" />
9+
</content>
10+
<orderEntry type="inheritedJdk" />
11+
<orderEntry type="sourceFolder" forTests="false" />
12+
<orderEntry type="library" name="Maven: org.openjfx:javafx-controls:13" level="project" />
13+
<orderEntry type="library" name="Maven: org.openjfx:javafx-controls:win:13" level="project" />
14+
<orderEntry type="library" name="Maven: org.openjfx:javafx-graphics:13" level="project" />
15+
<orderEntry type="library" name="Maven: org.openjfx:javafx-graphics:win:13" level="project" />
16+
<orderEntry type="library" name="Maven: org.openjfx:javafx-base:13" level="project" />
17+
<orderEntry type="library" name="Maven: org.openjfx:javafx-base:win:13" level="project" />
18+
<orderEntry type="library" name="Maven: org.openjfx:javafx-fxml:13" level="project" />
19+
<orderEntry type="library" name="Maven: org.openjfx:javafx-fxml:win:13" level="project" />
20+
</component>
21+
</module>

lab_02/src/main/java/lab_02/App.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ private void initComponents(Stage stage) {
7171
TextField secTextField = new TextField();
7272
grid.add(secTextField, 1, 3);
7373

74+
Label clockLbl = new Label("Time:");
75+
grid.add(clockLbl, 0, 5);
76+
time = new Label("");
77+
grid.add(time, 1, 5);
78+
7479
Button btn = new Button("Set time");
7580
HBox hbBtn = new HBox(10);
7681
hbBtn.setAlignment(Pos.BOTTOM_LEFT);
@@ -126,11 +131,6 @@ public void handle(ActionEvent e) {
126131
Label timeAlarm = new Label(alarm.printTime());
127132
grid.add(timeAlarm, 1, 5 + alarmCount);
128133
}
129-
130-
Label clock = new Label("Time:");
131-
grid.add(clock, 0, 5);
132-
time = new Label("");
133-
grid.add(time, 1, 5);
134134
}
135135
});
136136

@@ -197,12 +197,13 @@ public void handle(ActionEvent e) {
197197
stopBtn.setDisable(true);
198198
startBtn.setDisable(true);
199199

200-
for (int i = 5 + alarmCount; i >= 5; i--)
200+
for (int i = 5 + alarmCount; i > 5; i--)
201201
deleteRow(i);
202202

203203
alarmCount = 0;
204204
isTime = false;
205205
scenetitle.setText("SetClock");
206+
time.setText("");
206207
}
207208
});
208209

0 commit comments

Comments
 (0)