How to implement  a mask in a JtextField??? Is it  possible???

I wish to have a masked edit box in Java ( a control present in VB). It is similar to a JTextField. In the control, if I specify a mask for data entry such as 99/99/9999 the box will appear on the form with dashes as --/--/----, and it will allow data entry only on those dashes and only numbers. Similarily for characters you specify "#".
Anyone has an idea of java controls that can be used in Java for this purpose???
I already know how to validate a date��.for that I used SimpleDateFormat�..but I would like that in the jtextfield appears something like --/--/---- because my user will introduce the date.
Thanks in advance,
Mary

Yes it is possible.....i found how reach it...
date = new JFormattedTextField (new MaskFormatter("##/##/####")) ;
Thanks any way,
Mary

Similar Messages

  • How to implement Scroling Messages in Forms 6i

    Dear Friends,
    I have a requirement as stated below.
    I have to fetch data from table and display on the forms as a scroling message ( like messages appearing on the webpage , moving from right to left ) in forms 6i application.
    I dont have any idea about how to implement it iam not sure if it is possible or not
    If you have any idea how to acheive this please suggest me
    Regards,
    Khader

    Write Code in When-New-form instance
    if id_null(create_timer('SCROLL_TIMER', 200, REPEAT)) then
         null;
    end if;
    When-Timer-expired
    DECLARE
         TimerName varchar2(40) := get_application_property(TIMER_NAME);
    BEGIN
         if TimerName = 'SCROLL_TIMER' then
              scroll_view('CNv_SCROLL', 0, mod(get_view_property('CNv_SCROLL', VIEWPORT_Y_POS_ON_CANVAS)+1, 37));
    end if;
    END;
    Create a Stacked CNV_SCROLL on you canvas
    and write any text in CNV_Scroll
    I hope your problem will solve.

  • How to implement autocomplete?

    Hello,
    I have a String array with strings in non-alphabethical order.
    I would like to implement autocomplete (just like in IE address line) on a JTextField.
    I guess I'll need to put some listener on textfield, but which? And how to handle array - sort it before use? Any other possibilities?

    Well, first you'd need something to compare the String being typed in to, so that you know what the user might be trying to type. Then, I guess you'd need a KeyListener on text field, so each time a key is pressed, you run a search and return all the possible Strings that could match it.
    I'd be a little lost as to how to implement the drop-down list like IE (or Windows in general) has to handle auto-complete. The other way to handle it would be to have the word fill itself into the textbox as you type, leaving the guessed part highlighted so you can continue to type, and continue to get suggestions. This approach seems a bit easier, and could be handled fairly easily.

  • Mask in a JTextField

    How I set a mask (for example for a date) in a JTextField??? I think that I can make it using a Document, but how???
    Thanks in advance!!!

    First sorry for one mistake: TextDocument is not a standard class, the right one is PlainDocument.
    Here is an example:
    public class TextDocument extends PlainDocument{
        protected int characterLimit = 10;
         private int firstDayDigit = 0;
         public TextDocument() {
              this(10);
         public TextDocument(int limit) {
              super();
              characterLimit = limit;
          * Process the input from the user and check for the
          * right numbers.
         public void insertString(int offset, String str, AttributeSet attrib) throws BadLocationException {
              if(offset == 0 && !str.equals("00.00.0000")){
                   try{
                        firstDayDigit = Integer.parseInt(str);
                   }catch(NumberFormatException nfe){
                        Toolkit.getDefaultToolkit().beep();
                        return;
              if(!str.equals("00.00.0000")){
                   try{
                        int digit = Integer.parseInt(str);
                   }catch(NumberFormatException nfe){
                        str = "0";
              if(str.length() == 1) {
                   switch(offset){
                        case 0:
                             //check for the correct day
                             if(Integer.parseInt(str) > 3){
                                  str = "0";
                             removeIt(offset, str, attrib);
                             break;
                        case 1:
                             if(firstDayDigit == 3){
                                  if(Integer.parseInt(str) > 1){
                                       str = "0";
                             removeIt(offset, str, attrib);
                             break;
                        case 3:
                             //check for the correct month
                             if(Integer.parseInt(str) > 1){
                                  str = "0";
                             removeIt(offset, str, attrib);
                             break;
                        case 6:
                             //check for the correct year
                             if(Integer.parseInt(str) != 2){
                                  str = "2";
                             removeIt(offset, str, attrib);
                             break;
                        case 4:
                        case 7:
                        case 8:
                        case 9:
                             removeIt(offset, str, attrib);
                             break;
                        case 2:
                            // user did not type in a '-'
                            if(!str.equals(".")) {
                                  // remove the '.' if there is one
                                  try{
                                       remove(offset, 1);
                                  }catch(BadLocationException ble){
                                       // don't throw back to calling method
                                  // insert another '.'
                                  super.insertString(offset, ".", attrib);
                                  // remove the next character in the field
                                  try {
                                       remove(offset + 1, 1);
                                  } catch(BadLocationException ble) {
                                       // don't throw back to calling method
                                  if(Integer.parseInt(str) > 1){
                                       str = "0";
                                  // insert the new character in it's place
                                  super.insertString(offset + 1, str, attrib);
                             } else {
                                  // user did type in a '.', remove the old on
                                  try {
                                       remove(offset, 1);
                                  } catch(BadLocationException ble){
                                       // don't throw back to calling method
                                  // and insert a new one
                                  super.insertString(offset, str, attrib);
                             break;
                        case 5:
                            // user did not type in a '.'
                            if(!str.equals(".")) {
                                  // remove the '.' if there is one
                                  try{
                                       remove(offset, 1);
                                  }catch(BadLocationException ble){
                                       // don't throw back to calling method
                                  // insert another '.'
                                  super.insertString(offset, ".", attrib);
                                  // remove the next character in the field
                                  try {
                                       remove(offset + 1, 1);
                                  } catch(BadLocationException ble) {
                                       // don't throw back to calling method
                                  if(Integer.parseInt(str) != 2){
                                       str = "2";
                                  // insert the new character in it's place
                                  super.insertString(offset + 1, str, attrib);
                             } else {
                                  // user did type in a '.', remove the old on
                                  try {
                                       remove(offset, 1);
                                  } catch(BadLocationException ble){
                                       // don't throw back to calling method
                                  // and insert a new one
                                  super.insertString(offset, str, attrib);
                             break;
                        default:
                             throw new BadLocationException("Limit of " + characterLimit + " characters.", offset);
              } else {
                   for(int i = offset; i < offset + str.length(); i++) {
                        insertString(i, ""+ str.charAt(i), attrib);
         protected void removeIt(int offset, String str, AttributeSet attrib) throws BadLocationException{
              try {
                   remove(offset, 1);
              }catch(BadLocationException ble) {
              super.insertString(offset, str, attrib);
    }

  • How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?

    Hi
    If a organization have 200 to 300 daily complains of there IT equipment/Software/Network e.t.c.
    How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?
    Is there any standard DataSources/InfoObjects/DSOs/InfoCubes etc. available in SAP BI Content?

    Imran,
    The point I think was to ensure that you knew exactly what was required. A customer service desk can have many interpretations from a BI perspective.
    You could have :
    1. Operational reports - calls attended per shift , Average number of calls per person , Seasonality in the calls coming in etc
    2. Analytic views - Utilization of resources , Average call time and trending , customer satisfaction , average wait time
    3. Strategic - Call volumes corresponding to campaigns etc , Employee churn and related call times
    Based on these you would then have to construct your models which would be populated by data from the MySQL instance for you to report.
    Else if you have BWA you could have data discovery instead or if you have HANA - you could do even more and if you have a HANA sidecar - you technically dont need BW. The possibilities are virtually endless - it depends on how you want to drive it and how the end user ( client ) sees value in the same.

  • How to implement implicit and explicit enhancement points

    Hi,
    Can anybody please provide some technical aspects of enhancement spots. I have gone through several sap sites and help poratl but have not get much technical things (how to implement or related t codes). please do not provide link to read theories.
    Rgds
    sudhanshu

    Hi,
    Refer to this link...
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5f/103a4280da9923e10000000a155106/content.htm

  • How many types of authentications in sharepoint and how to implement those authentication in sharepoint?

    Hi All,
    How many types of authentications in sharepoint and how to implement those authentication in sharepoint?
    can any one explain the above things with examples?
    Thanks in Advance!

    In addition to
    A Sai Gunaranjan you can also check this URL for Sharepoint 2010:
    http://technet.microsoft.com/en-us/library/cc288475(v=office.14).aspx
    http://www.codeproject.com/Tips/382312/SharePoint-2010-Form-Based-Authentication
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote***

  • How to Implement custom share functionality in SharePoint 2013 document Lib programmatically?

    Hi,
    I have created custom action for Share functionality in document library.
    On Share action i'm showing Model pop up with Share form with addition functionality.
    I am developing custom share functionality because there is some addition functionality related to this.
    How to Implement custom share functionality in SharePoint 2013  document Lib pro-grammatically?
    Regards,
    - Siddhehswar

    Hi Siddhehswar:
    I would suggest that you use the
    Ribbon. Because this is a flexible way for SharePoint. In my project experience, I always suggest my customers to use it. In the feature, if my customers have customization about permission then i can accomplish this as soon
    as possible. Simple put, I utilize this perfect mechanism to resolve our complex project requirement. Maybe we customize Upload/ Edit/ Modify/ Barcode/ Send mail etc... For example:
    We customize <Edit> Ribbon. As shown below.
    When user click <Edit Item>, the system will
    render customized pop up window.
    Will

  • Can't Figure Out How To Implement IEnumerable T

    I have no problem implementing IEnumerable but can't figure out how to implement IEnumerable<T>. Using the non-generic ArrayList, I have this code:
    class PeopleCollection : IEnumerable
    ArrayList people = new ArrayList();
    public PeopleCollection() { }
    public IEnumerator GetEnumerator()
    return people.GetEnumerator();
    class Program
    static void Main(string[] args)
    PeopleCollection collection = new PeopleCollection();
    foreach (Person p in collection)
    Console.WriteLine(p);
    I'm trying to do the same thing (using a List<Person> as the member variable instead of ArrayList) but get compile errors involving improper return types on my GetEnumerator() method. I start out with this:
    class PeopleCollection : IEnumerable<Person>
    List<Person> myPeople = new List<Person>();
    public PeopleCollection() { }
    public IEnumerator<Person> GetEnumerator()
    throw new NotImplementedException();
    IEnumerator IEnumerable.GetEnumerator()
    throw new NotImplementedException();
    class Program
    static void Main(string[] args)
    // Create a PeopleCollection object.
    PeopleCollection peopleCollection = new PeopleCollection();
    // Iterate over the collection.
    foreach (Person p in peopleCollection)
    Console.WriteLine(p);
    Console.ReadLine();
    That code compiles (basically because I haven't really done anything yet), but I get compile errors when I try to implement the GetEnumerator() methods.

    The List<T> class implements the IEnumerable<T> interface, so your enumerator can return the GetEnumerator call from the list.
    class PeopleCollection : IEnumerable<Person>
    List<Person> myPeople = new List<Person>();
    public PeopleCollection() { }
    public IEnumerator<Person> GetEnumerator()
    return myPeople.GetEnumerator();
    IEnumerator IEnumerable.GetEnumerator()
    return myPeople.GetEnumerator();
    class Program
    static void Main(string[] args)
    // Create a PeopleCollection object.
    PeopleCollection peopleCollection = new PeopleCollection();
    // Iterate over the collection.
    foreach (Person p in peopleCollection)
    Console.WriteLine(p);
    Console.ReadLine();

  • How to implement Tool TIP in Table Control

    Hello Everyone,
    Can you please tell me how to implement a tooltip messages in table control columns.
    The Tooltip contains a simple message like "Doublde click on column.
    Thanks in advance.
    Edited by: Suruchi Razdan on Jun 6, 2011 7:57 AM

    Hello,
    In table Control->first Header Row has chance to maintain the Tooltip option.
    In table control columns maintain Double click options in attributes .
    Regards,
    Praveen

  • How to implement a java class in my form .

    Hi All ,
    I'm trying to create a Button or a Bean Area Item and Implement a class to it on the ( IMPLEMENTATION CLASS ) property such as ( oracle.forms.demos.RoundedButton ) class . but it doesn't work ... please tell me how to implement such a class to my button .
    Thanx a lot for your help.
    AIN
    null

    hi [email protected]
    tell me my friend .. how can i extend
    the standard Forms button in Java ? ... what is the tool for that ... can you explain more please .. or can you give me a full example ... i don't have any expereience on that .. i'm waiting for your reply .
    Thanx a lot for your cooperation .
    Ali
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    Henrik, the Java importer lets you call Java classes on the app server side - I think what Ali is trying to do is integrate on the client side.
    If you want to add your own button then if you extend the standard Forms button in Java and then use this class name in the implementation class property then the Java for your button will be used instead of the standard Forms button. And since it has extended the basic Forms button it has all the standard button functionality.
    There is a white paper on OTN about this and we have created a new white paper which will be out in a couple of months (I think).
    Regards
    Grant Ronald<HR></BLOCKQUOTE>
    null

  • How to implement a file system in my app?

    How to implement a file system in my app? So that we can connect to my iPhone via Finder->Go->Connect to Server. And my iPhone will show as a shared disk. Any ideas about it? Thanks.

    Hi Rain--
    From webdav.org:
    DAV-E is a WebDAV client for iPhone, with free and full versions. It provides remote file browsing via WebDAV, and can be used to upload pictures taken with the iPhone.
    http://greenbytes.de/dav-e.html
    http://www.greenbytes.de/tech/webdav/
    Hope this helps.

  • How to implement remote blob storage in SharePoint 2013

    How to implement remote blob storage in SharePoint 2013 

    Try below:
    http://blogs.technet.com/b/wbaer/archive/2013/05/23/deploying-remote-blob-storage-with-sql-server-2012-alwayson-availability-groups.aspx
    If this helped you resolve your issue, please mark it Answered. You can reach me through http://itfreesupport.com/

  • How to implement tool-tip for the list items for the Choice column in SharePoint 2013

    I had created a simple list with a "Choice" column, i have three entries in my drop-down, 
    First Entry
    Second Entry
    Third Entry.
    If i select any entries in drop-down and hour-over (Second Entry), a
    tool-tip need need to show. 
    Is it possible? If yes how to implement any help will be appreciated.

    Hi,
    We can use JavaScript to achieve it.
    The following code for your reference:
    <script type="text/javascript" src="/sites/DennisSite/Shared%20Documents/js/wz_tooltip.js"></script>
    <script type="text/javascript" src="/sites/DennisSite/Shared%20Documents/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
    $(function () {
    $("select[title='Choice']").change(function(){
    Tip($(this).val());
    $("select[title='Choice']").mouseout(function(){
    UnTip();
    </script>
    Download wz_tooltip.js:
    http://www.walterzorn.de/en/tooltip/tooltip_e.htm#download
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

Maybe you are looking for

  • Data Recovery on Nokia Lumia 800

    I recently went on an incredibly moving trip to Poland and took many photos and videos. My Nokia Lumia 800 ran out of battery, so I charged it overnight. When I woke up to switch it on, the memory formatted, which meant I lost so many important photo

  • Strange issue with external monitor, only working when external speakers plugged in

    Hey – I am having a very strange issue with my external monitor; where it only works if my external speakers are plugged in and connected. I am using a late 2011 Macbook pro, running Mavericks 10.9.4, along with an MBox 2 (USB Audio Interface), and t

  • How to record sound into array using DAQ ?

    Hi to everyone Im last year student , im using LABVIEW for the first time. i have an myDAQ , i need to record audio go through the analog ports/AUDIO INPUT of the myDAQ, into array, for later singal proccesing. its for my final project.

  • IT0041 : Same date type with different values in the same infotype

    Hi, Is it possible to store in the 0041 infotype, the same type date but with a diffentent date. Example : IT0041 employee 1000: date type : xx 01.05.10 date type : xx 02.05.10..... Thanks

  • Number of execute threads

    Is there a limit to the number of execute threads in the Weblogic Server 5.x. (4.5.x had a limit of 400). Thanks -Rama