You should add import java.util.List;
instead of import java.awt.List;
. The former one is generic list, the latter one is display element.
java.awt.List - The List component presents the user with a scrolling list of text items.
java.util.List - An ordered collection (also known as a sequence).