I am using both JLabels and JTextFields, and need to be able to truncate my doubles to two decimal places when they are displayed by the application.
How can I perform this truncation, preferably without switching to JFormattedTextFields?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use DecimalFormat class. Here is an explanation