Currently, I'm programming a quiz game in Java using Swing. I also use the MVC Pattern and my ActionListener is placed in the control package.
I want a new question to show up after the current question is answered correctly. All answers are placed on buttons. I had the idea to compare the chosen answer with the question and if it is correct then the JLabel
shall be filled with another question. I could put all questions into the label with a loop and interrupt the loop as soon as the chosen answer is wrong.
But I do not know how to implement it.
The comparison of the answer and the question happens in the ActionListener
class and putting the question into the label is done in my panel class.