title: how do i get data from a DAO arraylist?
body: <p>I am trying to create a method to read data from my DAO arraylist class. i want the data of the current indexpossition to be shown in some textfields. 
  My problem is that i dont know how to create my method to get the data from my DAO arraylist class.
  i am swedish btw that's the reasons for the wied method names. </p>
  
  <pre><code>private void visaBil() {
  
      DTOBil[] bilar = dao.getAllDTOBil();
  
      for(DTOBil bil : bilar){
          text1.setText(bil.get(index).regnr);
          text2.setText(bil.get(index).marke);
          text3.setText(bil.get(index).modell);
          text4.setText(bil.get(index).sokVag);
  
          String source = text4.getText();
  
          try {
  
              jlBilder.setIcon(new ImageIcon(new URL(source)));
  
          } catch (MalformedURLException mue) {}
      }
  }
  </code></pre>
  
  <p>my DAOArarylist class (not all of it)</p>
  
  <pre><code>public class DAOBilArrayList implements DAOBil{
  private ArrayList&lt;DTOBil&gt; dtoBilar;
  
  
  
  public DAOBilArrayList(){
  
      dtoBilar = new ArrayList&lt;DTOBil&gt;();
  
      dtoBilar.add(new DTOBil("ABC123", "Citroen", "C4", "http://www.carsuk.net/wp-content/uploads/2011/09/Citroen-C4-Aircross-100x100.jpg"));
      dtoBilar.add(new DTOBil("DEF456", "Audi", "RS4", "http://www.carsuk.net/wp-content/uploads/2011/09/Audi-RS4-Avant-2013-Spy-Video-100x100.jpg"));
      dtoBilar.add(new DTOBil("GHH123", "BMW", "730Ld", "http://www.carsuk.net/wp-content/uploads/2011/09/BMW-730Ld-Chauffeur-100x100.jpg"));
  
  }
  
  
  
  @Override
  public void create(DTOBil dtobil) {
      dtoBilar.add(dtobil);
  }    
  
  @Override
  public DTOBil[] getAllDTOBil() {
      return dtoBilar.toArray(new DTOBil[dtoBilar.size()]);
  }
  </code></pre>
  
  <p>what do i do to get my visabil method to get the data from my DAO class?</p>