I am writing an application that requires a large amount of swing GUI components. I am having a lot of trouble organizing the class. Is there a methodology to organize and neatly layout class architecture?
I find my constructor confusing it consists of many components being initialized followed by several event handlers.
In addition, I have numerous anonymous and inner classes and my main class has become bloated. However, when I put the inner class event handlers in separate files I have trouble accessing the components of my main class. Is there a methodology to internally organize large swingGUI applications?
In larger swing projects I do partinioning of the app like that:
Have one class per GUI element like JPanel,JDialog etc.
Use a separate package for each screen, especially if you have to implement customized TableModels or other complex data structures
Don’t use anonymous and inner classes, implement instead an ActionListener and check ActionEvent.getActionCommand() in there.