Hello, I'm trying to add an icon to a JPanel in the event where a button is pressed. I have the following code:
Code:
private void button1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        javax.swing.ImageIcon icon = new javax.swing.ImageIcon("/home/bbraun/NetBeansProjects/RPGI/sample2.jpg");
        javax.swing.JLabel label = new javax.swing.JLabel();
        label.setIcon(icon);
...