List of utility methods to do JFrame Icon
void | getResourceIcon(JFrame fr, String name, Class callingClass) Set a icon for given frame CallingClass is used to determine where to find resource... try { ImageIcon i = null; i = new ImageIcon(callingClass.getResource(name)); fr.setIconImage(i.getImage()); } catch (Exception e) { System.out.println("Icon not loaded: " + name); |
void | loadIMageIconToPanel(JFrame frame, JPanel panel, ImageIcon icon) load I Mage Icon To Panel JLabel label = new JLabel();
label.setIcon(icon);
panel.add(label);
frame.add(panel);
frame.setVisible(true);
|
void | SET_FRAME_ICON(JFrame f, String iconPath) SEFRAMICON f.setIconImage(new ImageIcon(f.getClass().getResource(iconPath)).getImage());
|
void | setApplicationIcon(JFrame frame) set Application Icon try { frame.setIconImage(Toolkit.getDefaultToolkit() .getImage(new URL("http://gaggle.systemsbiology.net/images/icons/gaggle_icon_32x32.gif"))); } catch (MalformedURLException ignore) { ignore.printStackTrace(); |
void | setDefaultIcon(final JFrame window, final String imagepath) Sets the icon for a window. window.setIconImage(Toolkit.getDefaultToolkit().getImage(imagepath)); |
void | setIcon(javax.swing.JFrame jFrame, String icon) Change title bar icon. java.net.URL url = jFrame.getClass().getResource(icon); try { java.awt.Image img = jFrame.createImage((java.awt.image.ImageProducer) url.getContent()); jFrame.setIconImage(img); } catch (Exception e) { e.printStackTrace(); |
void | setIconImage(JFrame frame, Class> clazz, String path) set Icon Image BufferedImage image = readIconImage(clazz, path);
if (image != null) {
frame.setIconImage(image);
|
void | setIconImageFromResource(JFrame frame, String resource) Set the icon image for a JFrame from a resource in its class. Image image = null;
if (frame != null && resource != null) {
image = getImageFromClassResource(frame.getClass(), resource);
frame.setIconImage(image);
|
void | setIconOnFrame(JFrame frame) set Icon On Frame if (logoImage == null) { URL logoResourceURL = frame.getClass().getResource("/resources/SkyggeLogo.png"); ImageIcon logoImageIcon = new ImageIcon(logoResourceURL); logoImage = logoImageIcon.getImage(); frame.setIconImage(logoImage); |
void | setWindowIcon(JFrame jd) set Window Icon ImageIcon frameIcon = getDefaultFrameIcon();
if (frameIcon != null)
jd.setIconImage(frameIcon.getImage());
|