title: How do I connect one event from one button to another button?
body: <p>I've got a script, which reads and uploads the image, which executes by pushing on one button. I've got another button, which supposed to take this image and read the metadata. However, I dont know, how to connect these events. So, this is the code for first event, by first button.</p>
  
  <pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {         
      JFileChooser chooser = new JFileChooser();
      chooser.showDialog(null, "Open image");
      File file = chooser.getSelectedFile();
      String filename = file.getAbsolutePath();
      JTextField_path.setText(filename);
  
      ImageIcon icon= new ImageIcon(filename);
      jLabel_image.setIcon(icon);
  }                                        
  </code></pre>