Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
grobmeier committed Dec 17, 2023
1 parent d675dd6 commit c1341d3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
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;
Expand All @@ -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());

Expand All @@ -58,12 +55,15 @@ public ChainsawAbout(LogUI logUI) {
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);
Expand Down Expand Up @@ -106,6 +106,7 @@ public void run() {
}
}

@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
sleep = !visible;
Expand Down

0 comments on commit c1341d3

Please sign in to comment.