I'm trying to create a Java Swing-based simulation for a typical ASCII-based terminal. I have a content of the terminal screen as a 2-dimensional array where each element has a character plus foreground and background color.
The initial (naive) strategy was to have a JPanel and use its paintComponent(...) method to simply draw each individual character from the array using drawString(...) method at a specific coordinate (with the appropriate foreground and background color handling as well as necessary font metrics arithmetic).
It works fine - but painfully, unusably slow (especially if I maximize the window size).
Am I missing something obvious design wise?