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 Calculating widget costs Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Calculating widget costs" Watch "Calculating widget costs" New topic
Author

Calculating widget costs

Marcel Goulart
Greenhorn

Joined: Oct 14, 2012
Posts: 6
I am doing a homework assignment and I have to create a GUI that calculates the cost of an imaginary widget at a user specified price the only things that dont change is the percentage of tax(7.5%) and shipping costs(which is $9.95).
I am having an issue with the text fields doing the arithmetic and then displaying it.

Here is my code so far.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 925
    
    2

Hi Marcel,
Welcome to the Ranch!

You have mentioned you have an issue. What is it? Are you getting errors/exceptions when running the code? You need to provide us more details about the problem.
I see that you are getting the values from the textfield and converting it to the data type. I think you should proceed with writing the calculation code.

Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Marcel Goulart
Greenhorn

Joined: Oct 14, 2012
Posts: 6
Thank you for the welcome Ranganathan, I figured it out last night. I had a couple things in the wrong spot. I'll upload the correct code.

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 925
    
    2

Ok. So, is it all working ok now? do you need anymore help?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32708
    
    4
Marcel Goulart wrote:Thank you for the welcome Ranganathan, I figured it out last night. I had a couple things in the wrong spot. I'll upload the correct code.
. . .
Well done sorting it out , but that code needs a lot of editing if you want lots of marks. Get rid of all the tabs and excess blank lines, and make sure all code inside {} lines up vertically. We have some suggestions about formatting, which you might do well to look at.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Calculating widget costs
 
Similar Threads
Toggles Button and Additional Text
Help with Java Mortgage Program
Problems with this weeks code..Still not understanding Illegal start of expression...HELP PLEASE
Trying to figure out Exception Error in code
problems the program