How can I change the background color of the item which is selected in JList dynamically?
jList1.setSelectedIndex(currentLine); jList1.setSelectionBackground(Color.red);
Just Set Selected index of all the items you want to color in a loop and Change the color Accordingly!