I'm making a project that when you hit the button, an image appears in a JPanel.
But when I hit that button, nothing happens.
How to fix this code?
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
    // button sluiten van de deur
     try {
           writer.println("execute(lock, \"aepu04:SI-Test\");");
           writer.flush(); // flushes the buffer
            String path = "http://chart.finance.yahoo.com/z?s=GOOG&t=6m&q=l";
            System.out.println("Get Image from " + path);
            URL url = new URL(path);
            BufferedImage image = ImageIO.read(url);
            System.out.println("Load image into frame...");
            JLabel label = new JLabel(new ImageIcon(image));
            JPanel panel = jPanel1;
            panel.add(label);
            panel.setVisible(true);
        } catch (Exception ex) {
            chatTextArea.append("Message was not sent. \n");
        }