Salve.Vorrei inserire un immagine ad un bottone,come devo fare?
Ho provato con la classe
codice:public class ItemStrumentBar extends JButton{ public ItemStrumentBar(String pathImage){ ImageIcon icon = new ImageIcon(pathImage); JButton jb = new JButton(icon); } } facendo la chiamata : public class StrumentBar extends JToolBar{ private String pathImage = new String("C:/Documents and Settings/gennaro/Desktop/AG-SpIT/Images"); public StrumentBar() { this.add(new ItemStrumentBar(this.pathImage + "/" + new String("Annotation.gif"))); } }
MA nn funzione..GRazie

Rispondi quotando