• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

notepad

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello my friends i make a node pad then you can give me some suggestions i can improve my programming ability thank you

 
Marshal
Posts: 75839
361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don’t post 145 lines of code and expect people to read it all.
Don’t use languages other than English. This is an English-language website, so I have deleted your comments in your own language (?Chinese). And notepad is not an informative thread title. I thought it meant something completely different.

Don’t declare and initialise instance fields together. Declare the instance fields, but initialise them in the constructor. You probably don’t need any of those components as fields, but can set them up as local variables in the constructor.
All fields should have private access unless you are using them as public constants.
You should not use AWT components. Replace evey Component with its JComponent counterpart.
You should not import anything in the java.lang package; it is unnecessary.
Import each class individually, rather than on-demand import.
Avoid System.exit(); it can be too vicious, closing the JVM while you have a Process still running. If that Process has not completed, you may find your data or files seriously corrupted.
Avoid addActionListener(this), which creates very non-object-oriented code, and can be very difficult to maintain.
Your indentation and spacing are inconsistent. Sometimes you have spaces round binary operators and { }, sometimes you don’t.
You should probably use System.err for error messages rather than System.out.
You should simply use method calls in an actionPerformed() method, rather than inlining the code.
You ought to use buffered readers and writers for your files.

Not a lot to say, is there
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic