This content has been marked as final. Show 3 replies
In swing based application, Parent Frame filled with multiple Panels, for each panel i created separate class and added the required swing component.
components in one panel class require to update/modify components in another panel class.
For solving this problem i made the components & required methods in a class as STATIC and directly access from another class.
Is it right approach?
is there any other approach to solve this issue?Yes. Learn about the MVC design pattern.
You already implemented the V(iew)-part.
Now you have to create a M(odel) to hold the Information you want to manipulate and display and a C(ontroller) that changes this information upon the user input (could be combined...)
Usually the display components register themselves as Listeners to the model and the model publishes state changes to who ever has been registered...