How to add a backspace in calculator.java using swing?and remove the decimal

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jhonny smith

    #1

    How to add a backspace in calculator.java using swing?and remove the decimal

    how to add a backspace in calculator.java using swing?and remove the decimal
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    I'm guessing the decimals are shown in a TextField? If so, the TextField has a setText method which you are probably using already and the String class has a substring function as well as a length method. Combine those to modify your decimal.

    If you're not using a TextField, you'll have to give us some more information.

    Greetings,
    Nepomuk

    Comment

    Working...