How to write modular code in java swee netbeans applications?

I am creating a Java Swing Application in Netbeans. There are currently over 2000 lines of code. Is it correct to have that many lines in one file. Also, when I edit this file, the IDE got slow. Is there a way to overcome this?

+2


a source to share


1 answer


In larger swing projects I am dealing with an application like this:



  • You have one class for each GUI element like JPanel, JDialog, etc.

  • Use a separate package for each screen, especially if you need to implement custom TableModels or other complex data structures.

  • Don't use anonymous and inner classes, implement an ActionListener instead and check ActionEvent.getActionCommand () there.

+2


a source







All Articles