Converting from decimal to Hex and Binary

Posted on 2006-05-03
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.
Question by:gothteddy
    LVL 92

    Expert Comment

    LVL 11

    Accepted Solution


    Author Comment

    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 ---------- 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.*
    LVL 11

    Expert Comment

    result = Integer.praseInt(ioField.getText());
    should be
     result = Integer.parseInt(ioField.getText());

    spelling mistake

    Author Comment

    thanks for your help :)

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    tomcat users xml 7 92
    spring AOP 6 64
    Market Place not working in Eclipse Luna 2 62
    instanceof  operator in java 26 56
    It can often be challenging to stay relevant in the rapidly evolving world of technology. This can make recruiting talent difficult for companies of all sizes.
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now