View Full Version : JAVA JButton img
una domanda il file img dove lo devo mettere nella cartella del progetto?
new JButton("<html><img src=\"img.jpg\"></html>");
...l'immagine puoi metterla dove vuoi facendo attenzione al path relativo del progetto...
ImageIcon img = new ImageIcon("images/image.jpg");
JButton button = new JButton(img);
...ciao...
...l'immagine puoi metterla dove vuoi facendo attenzione al path relativo del progetto...
ImageIcon img = new ImageIcon("images/image.jpg");
JButton button = new JButton(img);
...ciao...
a ecco era quel image icon che mi fregava.. :D Thx
ora perņ mi mostra il button con dentro al img, come faccio a visualizzare img come button?
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.