aspose 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 557
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?


Learning Java using Eclipse on OpenSUSE 11.2
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: 19541
    
  16

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Code cleanup
 
Similar Threads
General question about ActionListeners accessing other GUI elements
Clicking works, but pushing "enter" return errors...how to fix? (on a button named "Enter")
Serious issue: NumberFormat String Parse int problem
Gui is running fine, don't know exactly how to code
how to listen for char ' and "?