title: How to execute a .java file on clicking a jbutton in jframe?
body: <p>On clicking the jbutton in a jframe, I want Start.java file to be executed;what to do?
  The Start.java is executing well. I want the same execution to be done when clicked on jbutton in jframe, please help me out.</p>
  
  <p>My jframe code has jbutton </p>
  
  <pre><code>private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {   
  
      // i want to execute Start.java file on clicking the button
  
       Start s = new Start();
       String in = s.getTxt;
       System.out.println(in);
      repaint();
   }  
  </code></pre>
  
  <p>My Start.java file is :</p>
  
  <pre><code>import java.awt.*;
  import java.awt.event.*;
  import javax.swing.*;
  
  
  public class Start extends JPanel{
  
  public String getTxt;
  public Start()
  {
  
   final  JTextField jf = new JTextField(20);
   jf.setBounds(30, 30, 250, 30);
   final JButton j1 = new JButton("OK");
   j1.setBounds(80, 80, 100, 30);
   setLayout(null);
  
   add(jf);
   add(j1);
  
     j1.addActionListener(new ActionListener() {
         @Override
         public void actionPerformed(ActionEvent e) {
  
  
                          getTxt = jf.getText();
                          System.out.println(getTxt);
  
                      }
                     });
    }
  
  
   public static void main(String[] args) {
  
      JFrame f = new JFrame("Interest");
      f.getContentPane().add(new Start());
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      f.setPreferredSize(new Dimension(310,250));
      f.setMaximumSize(new Dimension(310,250));
      f.setMinimumSize(new Dimension(310,250));
  
      f.pack();
      f.setVisible(true);
  }
  </code></pre>
  
  <p>}</p>