Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Fix issue with about dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
quanticc committed Nov 1, 2017
1 parent 05a6899 commit 1bc9b2d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/ui/AboutDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public class AboutDialog extends JDialog {

Expand Down Expand Up @@ -64,9 +68,11 @@ public AboutDialog(String version, String build) {
try {
URL aboutUrl = AboutDialog.class.getClassLoader().getResource("ui/about.html");
if (aboutUrl != null) {
aboutTextPane.setText(new String(Files.readAllBytes(Paths.get(aboutUrl.toURI()))));
try (BufferedReader reader = new BufferedReader(new InputStreamReader(aboutUrl.openStream()))) {
aboutTextPane.setText(reader.lines().collect(Collectors.joining()));
}
}
} catch (URISyntaxException | IOException e) {
} catch (IOException e) {
log.log(Level.FINE, "Could not display text", e);
}
contentPanel.add(aboutTextPane, BorderLayout.SOUTH);
Expand Down

0 comments on commit 1bc9b2d

Please sign in to comment.