I'm making a scoreboard for a simple word-game. The easiest way for this seems to be a JTable. I need both column headers and row headers, I believe this is achievable in JTable? For each game, the column headers should represent a random selection of predetermined categories, and the row headers should represent a random selection of characters from A to Z.
I started out making one enum for characters and one for categories. The plan was to take a random selection from it into an array and pass it to a class extending the AbstractTableModel. Then I figured it would be easier to just to create variables for the char and string arrays. The idea was to create a sub array from these with a random selection (5 characters and 5 strings). But I struggle with the creation of a random array. I figured I could use the Collections.shuffle and then Arrays.copyOfRange but this leads to a lot of conversion back and forth between List and array. Could anyone point me in the right direction here? I would like to do this as efficient and memory optimized as possible.
Please let me know if you need further details.