|
1 | 1 | package the.bytecode.club.jda.gui; |
2 | 2 |
|
3 | | -import the.bytecode.club.jda.JDA; |
| 3 | +import org.apache.commons.io.IOUtils; |
4 | 4 | import the.bytecode.club.jda.Resources; |
5 | | -import the.bytecode.club.jda.Settings; |
6 | 5 |
|
7 | 6 | import javax.swing.*; |
| 7 | +import javax.swing.text.html.HTMLEditorKit; |
8 | 8 | import java.awt.*; |
| 9 | +import java.io.IOException; |
9 | 10 |
|
10 | 11 | /** |
11 | 12 | * The about frame. |
|
15 | 16 | public class AboutWindow extends JFrame |
16 | 17 | { |
17 | 18 | private static final long serialVersionUID = -8230501978224923296L; |
18 | | - private JTextArea textArea = new JTextArea(); |
| 19 | + private JEditorPane editorPane; |
19 | 20 |
|
20 | 21 | public AboutWindow() |
21 | 22 | { |
22 | 23 | this.setIconImages(Resources.iconList); |
23 | | - setSize(Toolkit.getDefaultToolkit().getScreenSize()); |
| 24 | + setSize(new Dimension(800, 800)); |
24 | 25 | setType(Type.UTILITY); |
25 | 26 | setTitle("Java DisAssembler - About - https://the.bytecode.club"); |
26 | 27 | getContentPane().setLayout(new CardLayout(0, 0)); |
27 | | - JScrollPane scrollPane = new JScrollPane(); |
28 | | - getContentPane().add(scrollPane, "name_322439757638784"); |
29 | | - textArea.setWrapStyleWord(true); |
30 | | - textArea.setEnabled(false); |
31 | | - textArea.setDisabledTextColor(Color.BLACK); |
32 | | - scrollPane.setViewportView(textArea); |
33 | 28 | this.setResizable(false); |
34 | 29 | this.setLocationRelativeTo(null); |
| 30 | + |
| 31 | + JScrollPane scrollPane = new JScrollPane(); |
| 32 | + scrollPane.setHorizontalScrollBar(null); |
| 33 | + |
| 34 | + getContentPane().add(scrollPane, "name_322439757638784"); |
| 35 | + editorPane = new JEditorPane(); |
| 36 | + editorPane.setEditorKit(new HTMLEditorKit()); |
| 37 | + editorPane.setContentType("text/html"); |
| 38 | + editorPane.setEditable(false); |
| 39 | + try |
| 40 | + { |
| 41 | + editorPane.setText(IOUtils.toString(Resources.class.getResourceAsStream("/intro.html"), "UTF-8")); |
| 42 | + } |
| 43 | + catch (IOException e) |
| 44 | + { |
| 45 | + System.err.println("Couldn't load about html:"); |
| 46 | + e.printStackTrace(); |
| 47 | + } |
| 48 | + scrollPane.setViewportView(editorPane); |
35 | 49 | } |
36 | 50 |
|
37 | 51 | @Override |
38 | 52 | public void setVisible(boolean b) |
39 | 53 | { |
40 | 54 | super.setVisible(b); |
41 | | - textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, (int) JDA.viewer.fontSpinner.getValue())); |
42 | | - textArea.setText("Java DisAssembler " + JDA.version + " is a fork of Bytecode Viewer." + JDA.nl + |
43 | | - JDA.nl + |
44 | | - "Settings:" + JDA.nl + |
45 | | - " Preview Copy: " + JDA.previewCopy + JDA.nl + |
46 | | - " Java: " + Settings.JAVA_LOCATION.get() + JDA.nl + |
47 | | - " JDA Dir: " + JDA.getJDADirectory() + JDA.nl + |
48 | | - " Optional Lib: " + Settings.PATH.get() + JDA.nl + |
49 | | - "Command Line Input:" + JDA.nl + |
50 | | - " -help Displays the help menu" + JDA.nl + |
51 | | - " -list Displays the available decompilers" + JDA.nl + |
52 | | - " -decompiler <decompiler> Selects the decompiler, procyon by default" + JDA.nl + |
53 | | - " -i <input file> Selects the input file (Jar, Class, ZIP, all work automatically)" + JDA.nl + |
54 | | - " -o <output file> Selects the output file (Java or Java-Bytecode)" + JDA.nl + |
55 | | - " -t <target classname> Must either be the fully qualified classname or \"all\" to decompile all as zip" + JDA.nl + |
56 | | - " -nowait Doesn't wait for the user to read the CLI messages" + JDA.nl + JDA.nl + |
57 | | - "Keybinds:" + JDA.nl + |
58 | | - " CTRL + O: Open/add new jar/class/apk" + JDA.nl + |
59 | | - " CTLR + N: Reset the workspace" + JDA.nl + |
60 | | - " CTRL + W: Closes the currently opened tab" + JDA.nl + |
61 | | - " CTRL + S: Save classes as zip" + JDA.nl + |
62 | | - " CTRL + R: Run (EZ-Inject) - dynamically load the classes and invoke a main class" + JDA.nl + |
63 | | - JDA.nl + |
64 | | - "Code from various projects has been used, including but not limited to:" + JDA.nl + |
65 | | - " J-RET by WaterWolf" + JDA.nl + |
66 | | - " RSyntaxPane by Robert Futrell" + JDA.nl + |
67 | | - " Commons IO by Apache" + JDA.nl + |
68 | | - " ASM by OW2" + JDA.nl + |
69 | | - " FernFlower by Stiver" + JDA.nl + |
70 | | - " Procyon by Mstrobel" + JDA.nl + |
71 | | - " CFR by Lee Benfield" + JDA.nl + |
72 | | - " CFIDE by Bibl" + JDA.nl + |
73 | | - JDA.nl + |
74 | | - "If you're interested in Java Reverse Engineering, join The Bytecode Club - https://the.bytecode.club"); |
75 | 55 | } |
76 | 56 | } |
0 commit comments