How can I change the background color of the item which is selected in JList dynamically?
If I am clearly understanding you, look into javax.swing.ListCellRenderer. You need to reimplement it or extend javax.swing.DefaultListCellRenderer and customize the getListCellRendererComponent method.
javax.swing.ListCellRenderer
javax.swing.DefaultListCellRenderer
getListCellRendererComponent