You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gr...@apache.org on 2023/12/17 22:28:07 UTC
(logging-chainsaw) branch master updated: tidy up
This is an automated email from the ASF dual-hosted git repository.
grobmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-chainsaw.git
The following commit(s) were added to refs/heads/master by this push:
new c1341d3 tidy up
c1341d3 is described below
commit c1341d35c49d097b622ee5181e4b42ac19342657
Author: Christian Grobmeier <cg...@grobmeier.de>
AuthorDate: Sun Dec 17 23:28:02 2023 +0100
tidy up
---
src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java b/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java
index 88dc86a..06b1a93 100644
--- a/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java
+++ b/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java
@@ -21,6 +21,7 @@ import org.apache.log4j.chainsaw.help.HelpManager;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import java.awt.*;
+import java.io.IOException;
import org.apache.log4j.chainsaw.logui.LogUI;
import org.apache.logging.log4j.LogManager;
@@ -40,16 +41,12 @@ public class ChainsawAbout extends JDialog {
ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
- private final String url = ChainsawAbout.class.getName().replace('.', '/')
- + ".html";
-
private boolean sleep = false;
private final Object guard = new Object();
public ChainsawAbout(LogUI logUI) {
super(logUI, "About Chainsaw v2", true);
- // setResizable(false);
setBackground(Color.white);
getContentPane().setLayout(new BorderLayout());
@@ -58,12 +55,15 @@ public class ChainsawAbout extends JDialog {
closeButton.setDefaultCapable(true);
try {
+ String url = ChainsawAbout.class.getName().replace('.', '/') + ".html";
editPane.setPage(this.getClass().getClassLoader().getResource(url));
- } catch (Exception e) {
+ } catch (IOException e) {
throw new RuntimeException("Failed to find the About panel HTML", e);
}
+
getContentPane().add(scrollPane, BorderLayout.CENTER);
getContentPane().add(closeButton, BorderLayout.SOUTH);
+
JTextComponentFormatter.applySystemFontAndSize(editPane);
editPane.setEditable(false);
@@ -106,6 +106,7 @@ public class ChainsawAbout extends JDialog {
}
}
+ @Override
public void setVisible(boolean visible) {
super.setVisible(visible);
sleep = !visible;