Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8306935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:25:45+00:00 2026-06-08T18:25:45+00:00

in my application i have a Custom text box with BasicEditField.FILTER_NUMERIC . When the

  • 0

in my application i have a Custom text box with BasicEditField.FILTER_NUMERIC. When the user enter the value in the field the comma should be added to the Currency format .

EX:1,234,567,8…. like this.

In my code i tried like this.

protected boolean keyUp(int keycode, int time) {
    String entireText = getText();
    if (!entireText.equals(new String(""))) {
        double val = Double.parseDouble(entireText);

        String txt = Utile.formatNumber(val, 3, ",");// this will give the //comma separation format 
        setText(txt);// set the value in the text box
    }
    return super.keyUp(keycode, time);
}

it will give the correct number format… when i set the value in the text box it will through the IllegalArgumentException. I know BasicEditField.FILTER_NUMERIC will not allow the charector like comma(,)..

How can i achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:25:46+00:00Added an answer on June 8, 2026 at 6:25 pm

    I tried this way and it works fine…

    public class MyTextfilter extends TextFilter {
    private static TextFilter _tf = TextFilter.get(TextFilter.REAL_NUMERIC);
    
    public char convert(char character, int status) {
        char c = 0;
    
        c = _tf.convert(character, status);
        if (c != 0) {
            return c;
        }
    
        return 0;
    }
    
    public boolean validate(char character) {
        if (character == Characters.COMMA) {
            return true;
        }
    
        boolean b = _tf.validate(character);
        if (b) {
            return true;
    
        }
    
        return false;
    }
    }
    

    and call like this

    editField.setFilter(new MyTextfilter());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made one custom user control (search text box), which basically consists of
I have an image editing application, and I have custom adorners which get added
In my application I have a custom model binder that I set to the
In a WPF/MVVM application I have a custom control on a particular view. This
I'm working on a web application that will have a custom UI for the
I'm looking into some XSS prevention in my Java application. I currently have custom
I have a custom WebForms application that is utilized for our helpdesk that does
I have a custom desktop application which invokes an ASMX web service. The Service
We have a custom PHP/MySQL web application that gets updated and copied (using SFTP)
I have a custom built application framework written in PHP which I have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.