Created
December 10, 2012 18:43
-
-
Save ojacobson/4252421 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class QuizQuestion { | |
private final JLabel question; | |
public QuizQuestion(String question) { | |
this.question = new JLabel(question); | |
} | |
public void addToContainer(JComponent container) { | |
container.add(question); | |
} | |
} | |
/* ... */ | |
List<QuizQuestion> questions = loadQuestions(); | |
for (QuizQuestion question: questions) { | |
question.addToContainer(questionPanel); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment