2

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
rgksugan
  • 3,521
  • 12
  • 45
  • 53

1 Answers1

2

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
  • 68,052
  • 28
  • 140
  • 210
  • is there any way to configure netbeans so that it does all this modifications you mentioned to my existing project? – rgksugan May 10 '10 at 08:09
  • @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 May 10 '10 at 08:33