How to use multiple formats in one JFormattedTextField

Hi,
I am looking for a way to allow multiple formats in the same JFormattedTextField. Let's say I want to allow input like:
a) 123-AB-123
and
b) AB-12345-CD
Of course I could use an InputVerifier of my own combined with regular expressions to see if the input matches. But I like the way JFormattedTextField supports the UserInput by displaying a Placeholder String. So the User sees what the input might look like.
I'd tried to write a FormatterFactory of my own, which will return either a MaskFormatter for a) or b) but the JFormattedTextField checks out the Formatter only when gaining or loosing focus. What should happen is that it checks out the formatter after each keystroke.
Does anyone know a solution for this or how I could force the FormattedTextField to REget it's formatter?
Thanks
Thimo

Check out the following; it provides code for a regular expression formatter:
http://java.sun.com/products/jfc/tsc/articles/reftf/
Unfortunately, this does not support the 'placeholder' notion like the MaskFormatter does, if that's what you were talking about. I'm not sure how you could cobble them together, since with the MaskFormatter you don't have to type the mask literal characters, but you would need to with the regular expression.
: jay

Similar Messages

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to use Multiple Logos in One Smart Form?

    All,
    I have a client where they will have 2 logos for, e.g. "Invoicing" and want the form to decide which logo to print (based on plant code).
    We are using Smartforms.
    They want to use one form and based on the plant code - the form should determine which logo to print in the upper left corner of the invoice - how do you do this?
    This is not like having text to print on the form in the same place - my understanding is the logo is NOT some variable you can "clear" in the program and then use the logo you wish to show up on the printout.
    Does this have something to do with using multiple layouts within the same form?  You define a layout for each logo and then within the Smartform logic determine which layout to print?  And if that is true - does someone have sample code of how they determined which layout to use?
    Thanks - and as always - points rewarded where helpfull!
    Scott

    Hi Scott,
    Create two Graphics in Smartform window & place them wherver you want in the smart form.
    Now in Graphics node, you can find  'Conditions' tab, under this you can give the conditions.
    Hope this clue wil help you
    Regards,
    Sujatha

  • How to use multiple devices on one itunes account

    I have one itunes account, three iphones and one itouch.  How do we use the same itunes account be not share data, pictures, contacts etc?

    Connect the iOS device, select it from the left column under "devices" and just don't check those items in iTunes:
    Un-check the appropriate boxes for Contacts, etc. You can set these individual preferences for each iPhone and iPod Touch.

  • How  to use multiple channels with one remoteObject .

    hi,
    I have an application which is accessed through HPPS some
    times , also it can be access on server with http service.
    so I want to know how to configure config files or add
    runtime channels which will support either channel depending on
    the server it is accessed over.
    Is there any one who can help me to solve this...i need it
    soon.
    thank you...

    Hi,
    Please visit the URL below for details on adding channel sets
    at runtime. Add multiple channels to the channel set so that the
    fall back mechanism works.
    http://livedocs.adobe.com/blazeds/1/blazeds_devguide/runtimeconfig_5.html#194376
    Hope this helps.

  • How to use multiple senders with one account

    I have not moved from Entourage to Mail because I cannot figure out how to change sender addresses while using the same SMTP server.
    It is easy to do in Entourage. Is it possible in Mail?
    Thanks

    Not sure what you mean, but associating multiple email addresses with the same mail account is described in Mail Help’s “Adding multiple email alias addresses to an account” article.

  • How to use multiple models in one Function module?

    Hi,
    In my FM i am using 2 models and if i dont completely exit the Function and use the same fm for another query based on another
    model it is giving error saying invalid type.
    if iv_type_of_search = 'A'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BP_APPL' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).
    Contact Search
      elseif iv_type_of_search = 'C'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BP_APPL' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilContactAdvancedSearch' ).
    *Opportunity Search
      elseif iv_type_of_search = 'O'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BT' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BTQOpp' ).
      endif.
    Any idea how to over come this or remove the instance of the old query and model every time its run?
    it looks like the object of the last run is still there and i cant find any destructor method or way and
    if i exit se37 it works fine....

    Hi George,
    You can also set up your model (component set) with the components you need.
    Check it on:
    SPRO->CRM->CRM Cross-Application Components->Generic Interaction Layer/Object Layer->Basic Settings
    Kind regards,
    Garcia

  • How to use multiple events on one project?

    I want to make a show reel, this obviously involves using various events.
    I'm worried if I do this the whole file system will be a mess. Surely I should be sopying any files I want to use into the new showreel folder?
    How can i do this?
    Or is using various events ok?
    Hope someone ca recomend the best way forward

    You can edit from any event into the project. There is no need to copy the clips into a new event. When you're done you can archive the used clips into a new event.

  • How to use multiple ipods with one computer

    My 2 kids have an ipod touch each. How do I create their own files so that they do not have to have eachothers choices and games on eachothers device? As well, we have 2 iphones that are connected as well.

    Yo should read the manual.
    Open itunes, connect device, select what you want to sync, sync, disconnect device
    Connect other  device, select what you want to sync, sync, disconnect device
    Connect other  device, select what you want to sync, sync, disconnect device
    Connect other  device, select what you want to sync, sync, disconnect device

  • Help wanted - step by step process on how to use two ipods on one computer

    I'm just in the process of getting an ipod (waiting on delivery!) and want to know how it is possible to have two ipods using the same computer but synchronizing differently. I don't want to risk losing my partners music (he'll be very upset!) and I don't want to end up with his music on my ipod. I'd appreciate it if someone could give me a step by step guide or tell me where the best place to look for the answer is. Is it possible somehow to have two different libraries on one computer? Is that how it works?

    There are a couple of methods for using more than one iPod on a single computer. Have a look at the article linked below. Method one is to have two Mac or Windows user accounts which by definition would give you two completely separate libraries. Method two as Chris has already described above is to set your preferences so each iPod is updated with only certain playlists within one library. Have a look anyway and see what you think and go for whichever you feel suits your needs best: How To Use Multiple iPods with One Computer

  • Can someone tell me how to use 2 ipods on one computer

    well when anyone can ill be waiting for the answer i want to know cuz since im buying the ipod video i want to see if i can use the same computer that im uploading stuff to my ipod mini

    There is no limit to how many iPods can run on a single PC. Or how many PCs a single iPod can connect to. Either by Apple design or by any legal issues.
    These links should help:
    Natalie Beresford: Multiple iPods/iTunes Installations
    How to use multiple iPods with one computer
    How to share music between different accounts on a single computer

  • HELLP!! NEED TO KNOW HOW TO USE TWO IPODS ON ONE COMP!ASAP

    i have an ipod nano and an itunes account. Now my mom has a nano and we need to know if you can register them on the same account and how or any other tips for using two ipods on one comp!
    PLEASE HELP ASAP!
    ZACH

    Hello Zach,
    There are a couple of methods for using more than one iPod on a single computer. Have a look at the article linked below. Method one is to have two Mac or Windows user accounts which by definition would give you two completely separate libraries. Method two is to set your preferences so each iPod is updated with only certain playlists within one library. Have a look anyway and see what you think and go for whichever you feel suits your needs best: How To Use Multiple iPods with One Computer

  • How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?

    Hi All,
    Hope to you a very happy new year,
    I have two differnt LAP 1300 and 1200 in my network and I need to add theme to the WLC,
    I successed to add one of theme by the option 60 in the DHCP pool at the Core SW,
    So my quetion is below:
    How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?
    Thanks in Advanced,
    Ahmed,

    To add to Scott's post.  Option 60 would be useful if you needed to put certain types of AP on specific controllers.  Otherwise, no real need to use it for the most part.
    Though, I do recall an issue a few years ago that some windows machines had issues getting DHCP if option 43 is being returned.
    Now, on an IOS switch, you can only configure one option 60 per DHCP scope
    HTH,
    Steve
    Please remember to rate useful posts, and mark questions as answered

  • How to scan multiple pages in one file

    I would like to know how to scan multiple pages into one file.  There is no add button that comes up.  I have a HP Officejet 8600 and a macbook pro.  Please help, this would really help me out.

    Open Preview and use its "Import From Scanner" option in the File menu. This will launch the scanning interface, which has some standard and basic scanning controls. If you choose "PDF" as the file format to save as, then you will see an option to scan all images to one file. When you do this, you will scan and edit them individually, but Preview will save them to the same file when saved.

  • Hp printer f4488 HOW TO SCAN MULTIPLE SHEET IN ONE ATTACHMENT

    hp printer f4488 HOW TO SCAN MULTIPLE SHEET IN ONE ATTACHMENT Kindly suggest if any solution are their for above subject..

    Open Preview and use its "Import From Scanner" option in the File menu. This will launch the scanning interface, which has some standard and basic scanning controls. If you choose "PDF" as the file format to save as, then you will see an option to scan all images to one file. When you do this, you will scan and edit them individually, but Preview will save them to the same file when saved.

Maybe you are looking for