title: Display the next row of a List in a JTable
body: <p>I will try to explain as thorough as possible what I am trying to do, since I am very new at UIs. 
  I have a String List, let's call it user_decide, which contains different number of elements.
  For example </p>
  
  <pre><code>1st Row [192, 495, 393, 399]
  2nd Row [384, 493, 945, 559, 485]
  </code></pre>
  
  <p>These number represent the index of some arrays, for example </p>
  
  <pre><code>Name[192] = "John", Name[495] = "Mary" 
  Surname[192] = "Pap", Surname[495] = "Black"
  </code></pre>
  
  <p>I am trying to make a UI which will have a previous and a next button, as well as a JTable.</p>
  
  <p>The first time, my UI will show</p>
  
  <pre><code>1st Column 2nd Column 3rd Column 4th Column 5th Column
  Name       John       Mary       etc..
  Surname    Pap        Black
  </code></pre>
  
  <p>and when I press Next, it will display the next line: </p>
  
  <pre><code>1st Column 2nd Column    3rd Column    4th Column    5th Column 6th Column
  Name       Name[384]     Name[493]     Name[945]     etc... 
  Surname    Surname[384]  Surname[493]  Surname[945] 
  </code></pre>
  
  <p>What I have done so far, is a frame with lots of JTables.</p>
  
  <pre><code>JPanel panel = new JPanel();
  int cols = 0;
  Iterator&lt;String&gt; iterator = user_decide.iterator();
  while (iterator.hasNext())
      {
          String con = iterator.next();
          con = con.replaceAll("\\s", "").replaceAll("\\[", "").replaceAll("\\]", "");
          String conv [] = con.split("\\,");
          // It can be used for the "for-statement"
          cols = conv.length;
  
          List&lt;String&gt; column = new ArrayList&lt;String&gt;();
          // Giving the name of the columns
          for(int i = 0; i &lt; cols + 1; i ++)
          {
              if (i == 0) column.add("");
              else column.add("Column #" + i);    
          }
          // Setting the jtable with a specific number of columns
          String[] column_names = column.toArray(new String[column.size()]);
          tableModel = new DefaultTableModel( 17, cols);
          tableModel.setColumnIdentifiers(column_names);
              JTable table = new JTable(tableModel);
              // HERE I AM GOING TO PLACE MY DATA AFTERWARDS
              SetData(table, "Name",0,0);
              SetData(table, "Surname",1,0);
  
  
                  panel.add(new JScrollPane(table,
                  JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                  JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS));
                  }
      JFrame frame = new JFrame("Results");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setBounds(200, 200, 600, 400);
      frame.add(new JScrollPane(panel,
              JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
              JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS));
  
      frame.add(panel, BorderLayout.CENTER);
      frame.setVisible(true);
  }
  
  public void SetData(JTable table, Object obj, int row_index, int col_index){
        table.getModel().setValueAt(obj,row_index,col_index);
        }
  </code></pre>
  
  <p>and I had this next button when I was doing trying to do it with a table which would store all the data in a row. </p>
  
  <pre><code>JPanel navigation = new JPanel(
  new FlowLayout(FlowLayout.CENTER));
  JButton next = new JButton("NEXT");
  next.addActionListener( new ActionListener(){
          public void actionPerformed(ActionEvent ae) {
          int height = table.getRowHeight()*(rows-1);
          JScrollBar bar = scrollPane.getVerticalScrollBar();
          bar.setValue( bar.getValue()+height );
          }
  } );
  </code></pre>
  
  <p>I would appreciate any help.
  Thank you a lot for reading this.</p>