load image from classpath (it will be the jar file) @param pathInClasspath path in classpath @return the image, or an empty image if something went wrong
(String pathInClasspath)
| 196 | * @return the image, or an empty image if something went wrong |
| 197 | */ |
| 198 | public static final Image loadImage(String pathInClasspath) { |
| 199 | try { |
| 200 | return ImageIO.read(Note.class.getResource(pathInClasspath)); |
| 201 | } catch (IOException ex) { |
| 202 | BufferedImage i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); |
| 203 | i.setRGB(0, 0, 0); |
| 204 | return i; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | //UI Elements |
| 209 | private final JPanel wrapper1; //outer wrapper: it's the area that the user can use to resize the window |