|
@@ -25,6 +25,7 @@ package com.dmdirc.addons.ui_swing.dialogs.about;
|
25
|
25
|
import com.dmdirc.addons.ui_swing.UIUtilities;
|
26
|
26
|
import com.dmdirc.util.resourcemanager.ResourceManager;
|
27
|
27
|
|
|
28
|
+import java.awt.Font;
|
28
|
29
|
import java.io.BufferedReader;
|
29
|
30
|
import java.io.IOException;
|
30
|
31
|
import java.io.InputStream;
|
|
@@ -39,6 +40,8 @@ import javax.swing.JScrollPane;
|
39
|
40
|
import javax.swing.SwingUtilities;
|
40
|
41
|
import javax.swing.UIManager;
|
41
|
42
|
|
|
43
|
+import javax.swing.text.html.HTMLDocument;
|
|
44
|
+import javax.swing.text.html.HTMLEditorKit;
|
42
|
45
|
import net.miginfocom.swing.MigLayout;
|
43
|
46
|
|
44
|
47
|
/**
|
|
@@ -70,14 +73,14 @@ public final class LicensePanel extends JPanel {
|
70
|
73
|
getResourcesStartingWithAsInputStreams("com/dmdirc/licenses/"));
|
71
|
74
|
|
72
|
75
|
license = new JEditorPane();
|
73
|
|
- license.setContentType("text/html");
|
|
76
|
+ license.setEditorKit(new HTMLEditorKit());
|
|
77
|
+ final Font font = UIManager.getFont("Label.font");
|
|
78
|
+ ((HTMLDocument) license.getDocument()).getStyleSheet().addRule("body " +
|
|
79
|
+ "{ font-family: " + font.getFamily() + "; " + "font-size: " +
|
|
80
|
+ font.getSize() + "pt; }");
|
|
81
|
+
|
74
|
82
|
final StringBuilder licenseText = new StringBuilder();
|
75
|
83
|
licenseText.append("<html>");
|
76
|
|
- licenseText.append("<span style='font-family: ");
|
77
|
|
- licenseText.append(UIManager.getFont("TextField.font").getFamily());
|
78
|
|
- licenseText.append("; font-size:");
|
79
|
|
- licenseText.append(UIManager.getFont("TextField.font").getSize());
|
80
|
|
- licenseText.append("pt;'>");
|
81
|
84
|
licenseText.append("Below are the licenses used in various components of DMDirc: <br><ul>");
|
82
|
85
|
for (Entry<String, InputStream> entry : licenses.entrySet()) {
|
83
|
86
|
final String licenseString = entry.getKey().substring(entry.getKey().
|
|
@@ -101,7 +104,7 @@ public final class LicensePanel extends JPanel {
|
101
|
104
|
"<br>"));
|
102
|
105
|
}
|
103
|
106
|
}
|
104
|
|
- licenseText.append("</span></html>");
|
|
107
|
+ licenseText.append("</html>");
|
105
|
108
|
license.setText(licenseText.toString());
|
106
|
109
|
license.setEditable(false);
|
107
|
110
|
|