dynamic drop down menu with values returned in JSON format in Java
===

I am developing an application which sets up http connection with a website and by using Get call I am getting Data Set ID's I want to show these DATA SET ID's in a drop down menu , so that the user can select it.
I also want to store the selected data set id in a variable as it will be used in future in my application.
I used JComboBox but it is not helping me.

    combo.addActionListener(new ActionListener() {
                        @Override
      public void actionPerformed(ActionEvent e) {
        JComboBox cb = (JComboBox) e.getSource();
        String selected = (String) cb.getSelectedItem();
        labelp3.setText("You selected: " + selected);
        
      }
    } );

and this in the constructor of my Log-in class

     JComboBox combo = new JComboBox(DSid);`

this DSid is an string array which  is storing the data set id , using get call.

I am not able to create the drop down menu with the data set ids, it is being empty if I am using these.
So how can I create dynamic drop down menu and also store the selected value in a variable.

This is how my application looks:
![enter image description here][1]

The values shown in data set (2,3) are given by me statically in the DSid array in the class login.


  [1]: http://i.stack.imgur.com/KrPOy.jpg