473,421 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

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
Oct 17 '10 #1
1 4438
Nepomuk
3,112 Expert 2GB
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
Oct 19 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Oleg Konovalov | last post by:
Hi, I am trying to implement an application administrative tool with interactive console (i.e. showing some info to the user and taking user input) using Swing and JDK 1.4. Up until now I...
3
by: Harry | last post by:
Hi, Does anyone know how to remove decimal places? ie: I have 334.43 and I need it to be displayed as 33443. Sounds simple enough, but I cant seem to find anything that works! I have tried...
4
by: jaYPee | last post by:
I have a report created in crystal report. My problem is on how can I remove the decimal point without converting the value. say for example if I have this data: Unit 2 1.5 2 3
6
by: Chad | last post by:
I would like to remove the decimal but still show the cents using sprintf. char empheader; double totalwage = 123.45; sprintf(empheader, "%.2f", totalwage);
2
by: ssai | last post by:
hi guyz i know about swing concept partially.. now am tryin to connect ms access from swing.. if i do so am gettin access denied.. so plz help me to come out of this problem
4
by: Jazi | last post by:
Hello All, I have a function in C++ that takes an array of struct. I want to convert this function to java using SWIG. Here what I have structs.h typedef struct myStruct{ char name;
4
by: Yonih | last post by:
So I am trying to get this Calculator to work. It needs to take in a vaule, and select a shipping Everythin works great except the shipping part. I need it to take the shipping value and add it to...
2
by: Chamila | last post by:
Why am I getting errors when I try to run the calculator progam using Netbeans5.5? error :-" class,interface or enum expected" Also, explain what's"enum"?
2
by: nomad | last post by:
Hi, I was wondering how I would be able to remove a decimal point from a string value i.e. 10000.0 to 10000. Appreciate any help on this.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.