static public ImageIcon getImageIcon(String path) {
        InputStream stream = null;
        try {
            try {
                stream = UI.class.getResourceAsStream(path);
                if (stream == null && new File(path).exists()) stream = new FileInputStream(path);
                if (stream == null) throw new RuntimeException("Image not found: " + path);
                byte[] data = new byte[stream.available()];
                stream.read(data);
                return new ImageIcon(data);
            } finally {
                if (stream != null)
                    stream.close();
            }
        } catch (IOException ex) {
            throw new RuntimeException("Error reading image: " + path);
        }
    }