This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "notepad" Watch "notepad" New topic


qin weiping

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

Joined: Oct 13, 2005
Posts: 46424
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:
subject: notepad
It's not a secret anymore!