changed about box

This commit is contained in:
Denis Molony 2018-04-21 20:24:11 +10:00
parent 369144f8e1
commit 527497d848

View File

@ -2,9 +2,6 @@ package com.bytezone.diskbrowser.gui;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
@ -32,29 +29,29 @@ public class AboutAction extends DefaultAction
public void about () public void about ()
{ {
int build = 0; // int build = 0;
String buildDate = "<no date>"; // String buildDate = "<no date>";
Properties props = new Properties (); // Properties props = new Properties ();
InputStream in = this.getClass ().getResourceAsStream ("build.properties"); // InputStream in = this.getClass ().getResourceAsStream ("build.properties");
if (in != null) // if (in != null)
{ // {
try // try
{ // {
props.load (in); // props.load (in);
in.close (); // in.close ();
build = Integer.parseInt (props.getProperty ("build.number")); // build = Integer.parseInt (props.getProperty ("build.number"));
buildDate = props.getProperty ("build.date"); // buildDate = props.getProperty ("build.date");
} // }
catch (IOException e1) // catch (IOException e1)
{ // {
System.out.println ("Properties file not found"); // System.out.println ("Properties file not found");
} // }
} // }
JOptionPane.showMessageDialog (null, JOptionPane.showMessageDialog (null, "Author - Denis Molony" //
"Author - Denis Molony\nBuild #" // + "\nBuild #" + String.format ("%d", build) + " - " + buildDate + "\n" //
+ String.format ("%d", build) + " - " + buildDate + "\nGitHub - https://github.com/dmolony/DiskBrowser", //
+ "\n" + "\nContact - dmolony@iinet.net.au", // + "\nContact - dmolony@iinet.net.au", //
"About DiskBrowser", JOptionPane.INFORMATION_MESSAGE); "About DiskBrowser", JOptionPane.INFORMATION_MESSAGE);
} }
} }