Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
4ra1n committed Feb 8, 2023
1 parent f6b6c40 commit 31b912c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,6 @@ Others:
## 1.1

更新内容:
- [important] 选择文件时只显示JAR/WAR文件提高效率 #84
- [bug] 应该支持隐藏文件/目录 #85
- [improve] 限制JAR包大小防止加载过多过大的文件 #83
14 changes: 14 additions & 0 deletions src/main/java/com/chaitin/jar/analyzer/form/JarAnalyzerForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.filechooser.FileFilter;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
Expand Down Expand Up @@ -237,6 +238,19 @@ public void loadJar() {
selectJarFileButton.addActionListener(e -> {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileChooser.setFileHidingEnabled(true);
fileChooser.setFileFilter(new FileFilter() {
@Override
public boolean accept(File f) {
return f.getName().toLowerCase().endsWith(".jar") ||
f.getName().toLowerCase().endsWith(".war");
}

@Override
public String getDescription() {
return "NOT JAR/WAR";
}
});
int option = fileChooser.showOpenDialog(new JFrame());
if (option == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
Expand Down

0 comments on commit 31b912c

Please sign in to comment.