473,434 Members | 3,072 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,434 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 4439
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.
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.