Skip to content

Commit 7ec6aee

Browse files
committed
Adds Luyten Version to About, Closes #29
1 parent 6e49935 commit 7ec6aee

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

src/us/deathmarine/luyten/Luyten.java

+20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package us.deathmarine.luyten;
22

3+
import java.io.BufferedReader;
34
import java.io.File;
5+
import java.io.InputStreamReader;
46
import javax.swing.SwingUtilities;
57
import javax.swing.UIManager;
68

@@ -10,6 +12,7 @@
1012
public class Luyten {
1113

1214
public static void main(String[] args) {
15+
1316
try {
1417
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
1518
} catch (Exception e) {
@@ -42,4 +45,21 @@ public static File getFileFromCommandLine(String[] args) {
4245
}
4346
return fileFromCommandLine;
4447
}
48+
49+
public static String getVersion(){
50+
String result = "";
51+
try {
52+
String line;
53+
BufferedReader br = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("META-INF/maven/us.deathmarine/luyten/pom.properties")));
54+
while((line = br.readLine())!= null){
55+
if(line.contains("version"))
56+
result = line.split("=")[1];
57+
}
58+
br.close();
59+
} catch (Exception e) {
60+
return result;
61+
}
62+
return result;
63+
64+
}
4565
}

src/us/deathmarine/luyten/MainMenuBar.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ public void actionPerformed(ActionEvent e) {
461461
@Override
462462
public void actionPerformed(ActionEvent event) {
463463
JOptionPane.showMessageDialog(null,
464-
"Luyten Gui \n" +
465-
"by Deathmarine, Zerdei\n\n" +
466-
"Powered By\nProcyon "+Procyon.version()+
464+
"Luyten " + Luyten.getVersion() +
465+
"\nby Deathmarine, Zerdei\n\n" +
466+
"Powered By\nProcyon "+ Procyon.version()+
467467
"\n(c) 2015 Mike Strobel\n\n" +
468468
"RSyntaxTextArea\n" +
469469
"(c) 2012 Robert Futrell\n" +

0 commit comments

Comments
 (0)