?
Solved

Converting from decimal to Hex and Binary

Posted on 2006-05-03
5
Medium Priority
?
336 Views
Last Modified: 2010-04-01
I am currently making a calculator that also has the function of converting the current decimal number in the text field to Binary or Hex.

at this point i come to a slump have got everything done except the final conversion. could any of you give this destroyed brain a helping hand.
0
Comment
Question by:gothteddy
  • 2
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
fargo earned 2000 total points
ID: 16594699
0
 

Author Comment

by:gothteddy
ID: 16595698
I am using the Mindprod link fargo gave, but i still fail to see what is wrong with this...


else if (actionCommand.equals("Binary"))
            {
                  result = Integer.praseInt(ioField.getText());
                  ioField.setText(Integer.toString(result, 2));
            }

i get the error

---------- Java Compiler ----------
Calculator.java:280: cannot find symbol
symbol  : method praseInt(java.lang.String)
location: class java.lang.Integer
                  result = Integer.praseInt(ioField.getText());
                                        ^
1 error

Output completed (1 sec consumed) - Normal Termination

any ideas, i already import java.lang.*
0
 
LVL 11

Expert Comment

by:fargo
ID: 16595888
result = Integer.praseInt(ioField.getText());
should be
 result = Integer.parseInt(ioField.getText());

spelling mistake
0
 

Author Comment

by:gothteddy
ID: 16597425
thanks for your help :)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Currently, there is an issue with being able to copy values from an external application to a dropdown list in Project Web Access (PWA).  The standard copy and paste methods don't seem to work properly. Here is a way to accomplish this task to s…
With more and more companies allowing their employees to work remotely, it begs the question: What are some of the security risks involved with remote employees and what actions should we take to secure them?
Loops Section Overview
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question