-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResourcesPanel.java
More file actions
63 lines (56 loc) · 3.32 KB
/
Copy pathResourcesPanel.java
File metadata and controls
63 lines (56 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import javax.swing.*;
import java.awt.*;
public class ResourcePanel extends JPanel {
private JTextArea resourceList;
public ResourcePanel() {
setLayout(new BorderLayout());
JLabel resourcesLabel = new JLabel("Browse Free Resources", JLabel.CENTER);
resourcesLabel.setFont(new Font("Arial", Font.BOLD, 20));
add(resourcesLabel, BorderLayout.NORTH);
resourceList = new JTextArea(20, 50);
resourceList.setEditable(false);
resourceList.setText(fetchResources());
add(new JScrollPane(resourceList), BorderLayout.CENTER);
JPanel searchPanel = new JPanel(new GridLayout(0, 2));
searchPanel.add(new JLabel("Search:"));
JTextField searchField = new JTextField();
searchField.addActionListener(e -> searchResources(searchField.getText()));
searchPanel.add(searchField);
add(searchPanel, BorderLayout.SOUTH);
}
private String fetchResources() {
return "1. Debian: https://www.debian.org/\n" +
"2. Ubuntu: https://ubuntu.com/\n" +
"3. Fedora: https://getfedora.org/\n" +
"4. mergerfs: https://github.com/trapexit/mergerfs\n" +
"5. snapraid: http://www.snapraid.it/\n" +
"6. Compute Express Link (CXL): https://www.computeexpresslink.org/\n" +
"7. Geopotential Height Analysis: http://www.bom.gov.au/australia/charts/viewer/index.shtml?type=pressureHgt&level=850hPa&tz=AEDT&area=G&model=G&chartSubmit=Refresh+View\n" +
"8. NOAA Experimental Products: https://www.swpc.noaa.gov/products\n" +
"9. Spyder: https://www.spyder-ide.org/\n" +
"10. Anaconda: https://www.anaconda.com/\n" +
"11. TensorFlow: https://www.tensorflow.org/\n" +
"12. PyTorch: https://pytorch.org/\n" +
"13. MATLAB for free: https://github.com/kamyu104/Leetcode-Python/wiki/How-to-install-MATLAB-for-free\n" +
"14. WindowsXPE: https://win10se.cwcodes.net/Compressed/index.php?version=231120\n" +
"15. Radeon DATARAM RAMDisk: https://www.radeon.com/en-us/software/ramdisk\n" +
"16. qBittorrent: https://www.qbittorrent.org/\n" +
"17. Visual Studio Code: https://code.visualstudio.com/\n" +
"18. Visual Studio Community Edition: https://visualstudio.microsoft.com/vs/community/\n" +
"19. Defraggler: https://www.ccleaner.com/defraggler\n" +
"20. Android Secret Codes: https://www.techworm.net/2019/06/android-secret-codes.html\n" +
"21. iPhone Field Test: https://www.techworm.net/2018/10/iphone-hidden-dialer-codes.html\n" +
"22. TakeOwnershipPro: https://www.tweaking.com/content/page/take_ownership.html\n" +
"23. USGS Strategic Minerals Report: https://pubs.usgs.gov/pp/1802/pp1802_entirebook.pdf";
}
private void searchResources(String query) {
String resources = fetchResources();
StringBuilder result = new StringBuilder();
for (String line : resources.split("\n")) {
if (line.toLowerCase().contains(query.toLowerCase())) {
result.append(line).append("\n");
}
}
resourceList.setText(result.toString());
}
}