views:

41

answers:

1

I am creating my java Swing application in Netbeans. At present there are more than 2000 lines of code. Is it right to have these many number of lines in a single file. Moreover the IDE has become slow when i am editing this file. Is there any way to overcome this?

+1  A: 

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.

stacker
is there any way to configure netbeans so that it does all this modifications you mentioned to my existing project?
rgksugan
@rgksugan AFAIK there is not such an option, you should use standard refactoring, 2K lines is not huge this could be done manually in a few hours
stacker