File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes notepad Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "notepad" Watch "notepad" New topic
Author

notepad

qin weiping
Greenhorn

Joined: Jan 02, 2012
Posts: 8
hello my friends i make a node pad then you can give me some suggestions i can improve my programming ability thank you

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38349
    
  23
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: notepad