所以我的代码应该显示一个对话框,其上有选项,用户应该选择。无论用户选择哪个,它都会将文件的某个部分显示为数组,然后为该部分中的用户激发另一个选择。我不确切知道自己在做什么,而且我已尽力了解所有内容。
ArrayList<String> position = new ArrayList<String>();
int pick = 1;
boolean checkForSameStrings = false;
for(int pickCount = 0; pickCount < numOfTeams; pickCount++)
{
String pickPosition = JOptionPane.showInputDialog(null, "What position do you plan on drafting?");
for(int checkForSameArrayStrings = 0; checkForSameArrayStrings < positionLabel.size(); checkForSameArrayStrings++)
{
while(numOfTeams.equals(position.get(checkForSameArrayStrings)))
{
String nextPick;
checkForSameStrings = true;
nextPick = JOptionPane.showInputDialog(null, "Please enter a different team
position " + pick);
break;
}
}
position.add(pickPosition);
System.out.println(position.get(pickCount));
pick++;
}