File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Code cleanup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Code cleanup" Watch "Code cleanup" New topic
Author

Code cleanup

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

I was wondering if anybody could clean-up my code. I just implemented a two new lines and now one thing isn't working. I would probably be able to fix it if someone would clean up my code. By cleanup, I mean tell me what I don't need. There are lines I can get rid of but I don't know which ones because of the lengthiness of the code. Please help.
Thanks,
cc11rocks

Risk.java


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 563
What "one thing" isn't working? Was it working before? What two new lines did you add? Why?

Finally, how is anyone supposed to know what code your program doesn't need?


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

Greg Brannon wrote:What "one thing" isn't working? Was it working before? What two new lines did you add? Why?

Finally, how is anyone supposed to know what code your program doesn't need?

When you enter 0 or blank, it return system errors. With my previous code, it worked. The new lines i added were:

instead of:

I changed the code to this because it was not accepting anything greater than 999 due to automatic commas by NumberFormat. So either way, I have issues. Because I'm not relying on nos and yos, maybe I could get rid of some lines. If you could help me with any of the problems described, that would be great
Thanks,
cc11rocks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19783
    
  20

john price wrote:When you enter 0 or blank, it return system errors.

What kind of errors? TellTheDetails.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code cleanup