Apologies for the horrible title. I spent 10 minutes trying to explain this in one sentence and failed.
Although the application prompting this question is in Java (And
This simple matching game uses enum Gameto specify the constants needed for the game's four levels. By overriding toString() (and slightly violating the case convention for constants) the Game.values() can be used to populate the level selection gameCombo directly. Changing levels then requires little more than replacing the components and invoking validate() on the enclosing Container.