Monday, September 17, 2018

Add icon to java button


In this tutorial I show you how add icon to java application's button. This is very simple tutorial. Without coding you can easily add icon if you use netbeans IDE. Watch video tutorial for that.



jButton jbut = new JButton();
  try {
    Image img = ImageIO.read(getClass().getResource("iconFolder/iconName"));
    button.setIcon(new ImageIcon(img));
  } catch (Exception ex) {
    System.out.println(ex);
  }


No comments:

Post a Comment