Jlist doens't show DefaultListModel elements
<p>i have a JList component should me show a certain number of String when i click a jbutton component. I add every item (String) into a DefaultListModel and then pass it to the Jlist component in this way:</p>

<pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
    DefaultListModel&lt;String&gt; listModel = new DefaultListModel&lt;&gt;();
    listModel.addElement("USA");
    listModel.addElement("India");
    listModel.addElement("Vietnam");
    listModel.addElement("Canada");
    listModel.addElement("Denmark");
    listModel.addElement("France");
    listModel.addElement("Great Britain");
    listModel.addElement("Japan");

    //create the list
    countryList = new JList&lt;&gt;(listModel);
}       
</code></pre>

<p>where JList component is defined in the following ways:</p>

<pre><code>private JList&lt;String&gt; countryList;
</code></pre>

<p>when i run program my JList is empty and doesn't show me elements i added.
If i use this command:</p>

<pre><code>System.out.println(countryList.getModel());
</code></pre>

<p>for testing if items are added into the DefaultListModel component i can see them.
Why JList component doesn't shows me elements?
Thanks</p>