title: How to import specific data from textfile to jtextfield?
body: <p>I need help regarding my java GUI, I have a jform to add movie details into a textfile <a href="https://i.stack.imgur.com/Frftz.jpg" rel="nofollow noreferrer">add movie into textfile</a></p>
  <p>when I add the data and click the save button it will automatically print on the textfile file that has been declared inside the code.</p>
  <p>now I am creating another jform to display a specific data that has inside the textfile into a jtextfield. However, I can't seem to have any idea on how to do it. can anyone guide me through this?
  <a href="https://i.stack.imgur.com/dmnOv.png" rel="nofollow noreferrer">display textfile into jtextfield</a></p>
  <p>This is my code to display the added movie into the jtable</p>
  <pre><code>float subPrice,totalPrice,tax; 
  int stockqty = Integer.parseInt(stock.getText());
  float priceUnit = Float.parseFloat(unitP.getText());
  
  subPrice = priceUnit*stockqty;
  tax = (float) (subPrice*0.60);
  totalPrice = subPrice+tax; 
  
  MovieInventory.AddRowToJTable(new Object[]{
      
  movieID.getText(),
  movieName.getText(),
  yearR.getText(),
  language.getText(),
  genre.getSelectedItem(),
  rated.getSelectedItem(),
  duration.getText(),
  type.getSelectedItem(),
  stock.getText(),
  unitP.getText(),
  subPrice,
  totalPrice,
  
  });
  
  JOptionPane.showMessageDialog(this, &quot;Movie Add Succesfully!&quot;);
  }                    
  </code></pre>
  <p>For the save button this is my code to save the data that has been put inside jtable into the textfile.</p>
  <pre><code>    String filePath = &quot;/Users/finatasha/Documents/inventoryMovie.txt&quot;;
      File file = new File(filePath);
      try {
          
          FileWriter fw = new FileWriter(file);
          BufferedWriter bw = new BufferedWriter(fw);
          
          for(int i = 0; i &lt;jTable1.getRowCount(); i++){
              for(int j=0; j&lt; jTable1.getColumnCount(); j++){
                  bw.write(jTable1.getValueAt(i, j).toString()+&quot; ,&quot;);
                  //using comma to seperate data
              }
              bw.newLine();
          }
          
          bw.close();
          fw.close();
          JOptionPane.showMessageDialog(this, &quot;Data save to textfile successfully!&quot;);
          
      } catch (IOException ex) {
          Logger.getLogger(MovieInventory.class.getName()).log(Level.SEVERE, null, ex);
          JOptionPane.showMessageDialog(this, &quot;ERROR!&quot;);
      }
  </code></pre>