-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
launcher/src/me/vinceh121/wanderer/launcher/AboutDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package me.vinceh121.wanderer.launcher; | ||
|
||
import java.awt.Desktop; | ||
import java.io.IOException; | ||
import java.net.URISyntaxException; | ||
|
||
import javax.swing.JDialog; | ||
import javax.swing.JEditorPane; | ||
import javax.swing.event.HyperlinkEvent.EventType; | ||
|
||
public class AboutDialog extends JDialog { | ||
private static final long serialVersionUID = 1L; | ||
|
||
public AboutDialog() { | ||
this.setTitle("About Wanderer"); | ||
|
||
final JEditorPane txt = new JEditorPane(); | ||
txt.setEditable(false); | ||
txt.addHyperlinkListener(e -> { | ||
try { | ||
if (e.getEventType() == EventType.ACTIVATED) { | ||
Desktop.getDesktop().browse(e.getURL().toURI()); | ||
} | ||
} catch (IOException | URISyntaxException e1) { | ||
e1.printStackTrace(); | ||
} | ||
}); | ||
txt.setContentType("text/html"); | ||
txt.setText( | ||
"<h1>Wanderer</h1>" + "<p>A reimplementation of the 2002 video game Project Nomads by Radon Labs</p>" | ||
+ "<p><a href='https://github.com/vinceh121/wanderer'>Source code</a></p>" | ||
+ "<p>Licensed under the GNU AGPL V3</p>"); | ||
|
||
this.add(txt); | ||
|
||
this.pack(); | ||
this.setLocationRelativeTo(null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters