title: How to rename list of Object[] in a JList
body: <p>beginner here.</p>
  
  <p>I am working an app to display information to users about different companies. I get the info via API in different formats, some have fields which makes deserialization easier, and other responses contain only a List of Columns, and a List> of Rows. I recreated a minimal JFrame to show my problem:</p>
  
  <p><a href="https://i.stack.imgur.com/Qadwh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qadwh.png" alt="enter image description here"></a></p>
  
  <p>My question is about the latter. I iterate through the list and add every row to the JList, and once selected, the information contained within that list is displayed in JLabels.</p>
  
  <p>My questions is instead of having the whole list contained within each Object displayed in the JList, is there a way to have only certain values from each list displayed? For example, Date and Person? I do not have a class with getters and setters because the API response does not have fields.</p>
  
  <p>Here is the code for the window:</p>
  
  <pre><code>import javax.swing.*;
  import javax.swing.event.ListSelectionEvent;
  import javax.swing.event.ListSelectionListener;
  import java.awt.*;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.URL;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  
  public class Window extends JFrame {
  
  private JPanel contentPane;
  public JList list1;
  private JButton buttonSearch;
  private JTextField searchField;
  public JLabel nameValue;
  public JLabel roleValue;
  DefaultListModel listModel = new DefaultListModel();
  
  public String passingValue;
  public String passingValue2;
  
  
  public Window() {
      buttonSearch.addActionListener(new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
  
              try {
                  clearList();
  
                  URL apiURL = new URL("http://api.cloudquote.io/sage/getInsiderActions.json? 
       T=APIKEYHERE&amp;symbol=GOOG");
  
                  String readLine = null;
  
                  HttpURLConnection conn = (HttpURLConnection) apiURL.openConnection();
                  conn.setRequestMethod("GET");
  
  
                  int responseCode = conn.getResponseCode();
  
                  if (responseCode == HttpURLConnection.HTTP_OK) {
  
                      BufferedReader in = new BufferedReader(new 
       InputStreamReader(conn.getInputStream()));
                      StringBuffer response = new StringBuffer();
                      while ((readLine = in.readLine()) != null) {
                          response.append(readLine);
                      }
                      in.close();
  
                      String jsonResponse = response.toString();
  
                      Deserializer actions = new Gson().fromJson(jsonResponse, Deserializer.class);
  
                      Object[] newList = actions.getRows().toArray();
  
                      for (Object object : newList) {
                          listModel.addElement(object);
                      }
  
                      list1.setModel(listModel);
                  }
              } catch (Exception ex) {
                  ex.printStackTrace();
              }
          }
      });
      list1.addListSelectionListener(new ListSelectionListener() {
          @Override
          public void valueChanged(ListSelectionEvent e) {
              nameValue.setText("");
              roleValue.setText("");
  
              String stringTest = String.valueOf(list1.getSelectedValue());
              List&lt;String&gt; myList = new ArrayList&lt;String&gt;(Arrays.asList(stringTest.split(",")));
  
              passingValue = myList.get(0);
              passingValue2 = myList.get(2);
  
  
              nameValue.setText(passingValue);
              roleValue.setText(passingValue2);
          }
      });
       }
  
      public static void main(String[] args) {
      JFrame frame = new JFrame("Testing");
      frame.setContentPane(new Window().contentPane);
      frame.setPreferredSize(new Dimension(750, 500));
      frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
      frame.pack();
      frame.setVisible(true);
  
  
   }
  
   public void clearList() {
      list1.removeAll();
   }
  
  
  }
  </code></pre>
  
  <p>Here is my Deserialization Class to parse the JSON response:</p>
  
  <pre><code>   import com.google.gson.annotations.Expose;
     import com.google.gson.annotations.SerializedName;
  
     import java.util.List;
  
    public class Deserializer {
  
    @SerializedName("rows")
     @Expose
     private List&lt;List&lt;String&gt;&gt; rows = null;
    @SerializedName("columns")
    @Expose
    private List&lt;String&gt; columns = null;
  
    public List&lt;List&lt;String&gt;&gt; getRows() {
      return rows;
   }
  
    public void setRows(List&lt;List&lt;String&gt;&gt; rows) {
      this.rows = rows;
   }
  
    public List&lt;String&gt; getColumns() {
      return columns;
    }
  
    public void setColumns(List&lt;String&gt; columns) {
      this.columns = columns;
      }
  
      @Override
      public String toString() {
      return "Deserializer{" +
              "rows=" + rows +
              '}';
      }
    }
  </code></pre>
  
  <p>And finally here is what the JSON response looks like:</p>
  
  <pre><code>{
  "rows": [
  [
    "CapitalG LP",
    1678225,
    "",
    "C",
    "2020-02-13",
    830211,
    0,
    "A",
    "I",
    830211,
    "https://www.sec.gov/Archives/edgar/data/1535527/000089924320004527/xslF345X03/doc4.xml"
  ]],
  "columns": [
    "Insider",
    "CIK",
    "Role",
    "Transaction Code",
    "Transaction Date",
    "Shares",
    "Price Range",
    "Aquired/Disposal",
    "D/I Own",
    "Total Holdings",
    "Filing"
  ]
  }
  </code></pre>
  
  <p>What would be the best approach to solving this? 
  Thank you very much.</p>