You can't have variable names that are dynamically created like that, but you can use a collection. For example, you could create a
Map<String, JLabel> and add your labels to that. Then you can refer to individual labels using the String you used as a key, or you can easily iterate across all of them.