diff --git a/src/main/java/net/themusicinnoise/vaccalc/VacCalc.java b/src/main/java/net/themusicinnoise/vaccalc/VacCalc.java index 0639507..28ec803 100644 --- a/src/main/java/net/themusicinnoise/vaccalc/VacCalc.java +++ b/src/main/java/net/themusicinnoise/vaccalc/VacCalc.java @@ -3,9 +3,9 @@ package net.themusicinnoise.vaccalc; import javax.swing.*; import java.awt.*; import java.awt.event.*; -import java.io.BufferedReader; -import java.io.InputStreamReader; +import java.io.*; import java.time.YearMonth; +import java.util.Properties; import java.util.stream.Collectors; public class VacCalc extends JFrame { @@ -72,10 +72,17 @@ public class VacCalc extends JFrame { @Override public void actionPerformed(ActionEvent ev) { BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("about.html"))); + Properties properties = new Properties(); + try { + properties.load(getClass().getClassLoader().getResourceAsStream("project.properties")); + } catch (IOException e) { + System.err.println("Failed to load project properties."); + e.printStackTrace(); + } String aboutText = br.lines().collect(Collectors.joining()); - JOptionPane.showMessageDialog(VacCalc.this, - aboutText, - "About", JOptionPane.INFORMATION_MESSAGE); + aboutText = aboutText.replace("VERSION", properties.getProperty("version")); + JOptionPane.showMessageDialog(VacCalc.this, aboutText, "About", + JOptionPane.INFORMATION_MESSAGE); } }); helpMenu.add(aboutItem); diff --git a/src/main/resources/about.html b/src/main/resources/about.html index a0f21bd..07da33c 100644 --- a/src/main/resources/about.html +++ b/src/main/resources/about.html @@ -1,5 +1,5 @@ -
VacCalc v1.0.0
+VacCalc VERSION
Copyright © 2026 Nicolás A. Ortega Froysa <nicolas@ortegas.org>
License: Zlib
diff --git a/src/main/resources/project.properties b/src/main/resources/project.properties new file mode 100644 index 0000000..defbd48 --- /dev/null +++ b/src/main/resources/project.properties @@ -0,0 +1 @@ +version=${project.version}