Hi, guys. I'm very new to programming and i would like to know something. Am doing a program that changes screens depending on the button you click. Should i make every screen a class extending JPanel and create and add all the components that belong there, or should I stay with one JPanel and hide the components and show new ones to make an illusion that the screen changed, or should I do it all in the same class. ?Thank you.
Re: programming style
Please read: Thread: This Forum is for Saying Hi, not for Asking Technical Questions (READ BEFORE POSTING)
Why would you decide to make every screen a class? How are the screens related and how are they different? Draw out the relationship among them to get an idea.
Why would you decide to make just one JPanel and hide components? How many components would you have to hide? How hard would that be to maintain in comparison?
Why would you decide to make just one class? What is the goal of the program? Does the solution to the problem suggest more than one class?
Ask yourself a bunch of questions until one choice is a sure win.
If no choice becomes a sure win, pick the one you think is pretty.