Results 1 to 4 of 4

Thread: Strings in JavaFX

  1. #1
    Join Date
    Mar 2010
    Posts
    338

    Strings in JavaFX

    Hello,
    How can we check JavaFX a string consists only of figure? I saw that example in other languages there are "isdigit ()" is there an equivalent in JavaFX? I was trying few options but none of them worked. So, please help me with this. Also, if you have an sample code, it would be great. Thank you.

  2. #2
    Join Date
    Dec 2009
    Posts
    292

    Re: Strings in JavaFX

    In a JavaFX application you can use any Java classes, provided they have them in the classpath, so the answer to your question is yes. However pay attention to the fact that there are no primitive types in JavaFX (int, char, ...), but there is a cast intrinsic JavaFX.

  3. #3
    Join Date
    Mar 2010
    Posts
    182

    Re: Strings in JavaFX

    You can try the simple code below
    Code:
        var s: String = bind rwtx we replace (
            validated = false;
            try(
                n = Number.valueOf(rwtx);
                if(n> mx) mx = n;
                if(n <mn) mn = n; st = true;
                if(not waitForAction) Action();
            )catch(e: NumberFormatException) (
                st = false;
            )
        )

  4. #4
    Join Date
    Dec 2009
    Posts
    263

    Re: Strings in JavaFX

    In your other thread, number of characters in a textbox, my TextBox restricted entry to the figures, which is probably what you want. I use a regular expression for this, a little heavy for this use, but practical and easily given the speed of user input. You can also pre-compile the ER if necessary. By cons, it will not work on a mobile profile.

Similar Threads

  1. JavaFX into jsp file
    By Bottlenecked in forum Software Development
    Replies: 10
    Last Post: 01-09-2010, 10:22 PM
  2. JavaFX is the right choice?
    By Bricklayer in forum Software Development
    Replies: 6
    Last Post: 26-07-2010, 10:34 AM
  3. JavaFX for Web
    By Bricklayer in forum Windows Software
    Replies: 4
    Last Post: 15-07-2010, 01:21 PM
  4. javafx xml parsing example
    By russ_da_buss in forum Software Development
    Replies: 3
    Last Post: 10-08-2009, 06:56 PM
  5. JavaFX Mobile from Sun
    By Bon-Z in forum Portable Devices
    Replies: 1
    Last Post: 12-02-2009, 11:28 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,629,311.56282 seconds with 17 queries