Java tutorial
import javax.swing.JList; public class Main { public static void main(String[] args) { String[] items = { "A", "B", "C", "D" }; JList list = new JList(items); String prefix = "b"; int start = 0; int itemIx = list.getNextMatch(prefix, start, javax.swing.text.Position.Bias.Forward); System.out.println(itemIx); } }