I was having trouble trying to copy and paste the code here it said something about having unformatted?? i dont know its my first time but here is the troublesome code i'll link a pastebin so you can see too
whole code: http://pastebin.com/p6RQiSLz
the problematic code:
//City (JList with txtfield)
pane.add(lblCity);
lblCity.setForeground(Color.BLACK);
lblCity.setBounds(5,260,80,25);
pane.add(list);
list.setSelectedIndex(0);
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
list.setBackground(Color.BLACK);
list.setForeground(Color.WHITE);
list.setBounds(90,260,150,100);
list.setEnabled(false);
pane.add(txtCity);
txtCity.setBounds(90,380,150,25);
//================================TROUBLED BLOCK OF CODE============================================
list.addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent er){
txtCity.setText(listCity[listCity.getSelectedIndex]);
}
});