posted 7 years ago
So I have a program with a lot of JTextFields and JLabels, and they need to be accessed by all of the functions in a class. I've also learned that its bad programming practice to have a lot of global variables/components. So what's worse programming practice, making about 20 components global, or having your entire program in one long function? Or is there a way to avoid these problems?