Get an ImageIcon object from the Mode folder. Or when prefixed with /lib, load it from the main /lib folder. @since 3.0a6
(String filename)
| 733 | * @since 3.0a6 |
| 734 | */ |
| 735 | public ImageIcon loadIcon(String filename) { |
| 736 | if (filename.startsWith("/lib/")) { |
| 737 | return Toolkit.getLibIcon(filename.substring(5)); |
| 738 | } |
| 739 | File file = new File(folder, filename); |
| 740 | if (!file.exists()) { |
| 741 | // EditorConsole.systemErr.println("file does not exist: " + file.getAbsolutePath()); |
| 742 | return null; |
| 743 | } |
| 744 | // EditorConsole.systemErr.println("found: " + file.getAbsolutePath()); |
| 745 | return new ImageIcon(file.getAbsolutePath()); |
| 746 | } |
| 747 | |
| 748 | |
| 749 | /** |
no test coverage detected