title: How can i save .txt file at desired location using JFileChooser
body: <p>Using following code i can store program.txt in a working project folder, but how can I use JFileChooser or any other option to save file at a selected location?   </p>
  
  <pre><code>b2.addActionListener(new ActionListener() {
  
          @Override
          public void actionPerformed(ActionEvent arg0) {
              try {
  
                  o = new BufferedWriter(new FileWriter("program.txt"));
  
                  o.write(t1.getText());
                  o.write(",");
                  o.write(t2.getText());
                  o.write(",");
                  o.write(t3.getText());
                  o.write(",");
                  o.write(t4.getText());
                  o.write(",");
                  o.write(t5.getText());
                  o.write(",");
                  o.write(t6.getText());
                  o.write(",");
                  o.write(t7.getText());
                  o.write(",");
                  o.close();
  
  
              }
               catch (IOException e) {
                  e.printStackTrace();
              }
          }
      });
  </code></pre>