Page 3 of 3 FirstFirst 123
Results 41 to 54 of 54
Like Tree6Likes

Thread: Is it worth to learn Swing?

  1. #41
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,679
    Rep Power
    6

    Default Re: Is it worth to learn Swing?

    These SimpleXXXProperty objects are used in binding. A term in JavaFX that you really need to know. As soon as the value of the property changes, the other object that it is bound to will be updated. JavaFX uses Binding and Observables extensively.

    Helpful link: Using JavaFX Properties and Binding | JavaFX 2 Tutorials and Documentation
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  2. #42
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Is it worth to learn Swing?

    Is it possible to apply mathematic actions with them + - / * ??
    Java Code:
     Text answer = new Text ();
            answer.textProperty().bind( a.asString("You answered:  %d") );
    This seems to be only String results.
    But I wish that %d (SimpleIntegerProperty a;) to modify. For example..
    Once my program count all correct answers, that digit multiply by 10?

    Because I changed ...
    Java Code:
     answer.textProperty().bind( a.asString("You answered: " + %d*10 ) );
    Compilator marks as mistake.

  3. #43
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,679
    Rep Power
    6

    Default Re: Is it worth to learn Swing?

    I don't know if this is the correct way, but it works (which sort of makes it the correct way :)):
    Java Code:
            Text answer = new Text();
            a.addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    answer.setText( String.format("You answered: %d%%", newValue.intValue()*10));
                }
            });
    asdfg likes this.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  4. #44
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,130
    Rep Power
    23

    Default Re: Is it worth to learn Swing?

    Is there a reason for all that (unformatted) code?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #45
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    5,739
    Rep Power
    10

    Default Re: Is it worth to learn Swing?

    What I don't understand is that apparently the OP hijacked the thread without explanation and no one seems to care.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #46
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,130
    Rep Power
    23

    Default Re: Is it worth to learn Swing?

    Thread drift?
    :)
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #47
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    5,739
    Rep Power
    10

    Default Re: Is it worth to learn Swing?

    Not certain what there is to like about this. This is pretty much idiomatic for computing fibonacci's recursively. And the OP hijacked someone else's thread.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  8. #48
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,679
    Rep Power
    6

    Default Re: Is it worth to learn Swing?

    I would expect Jos to give him both barrels for hijacking a thread, posting an unrelated crappy unformatted code dump, asking no questions. I mean, I am feeling like I can help Samar out with a nice rant, but maybe a moderator can set things straight, move the code to a new thread, send him a warning and prepare to wave the ban stick.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  9. #49
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,130
    Rep Power
    23

    Default Re: Is it worth to learn Swing?

    Ah, I was just about to post that the OP is asdfg, but you mean Samar's OP!
    That makes a lot more sense.

    I've no idea what that code is (I avoid trying to parse unformatted code), but if it's nothing to do with asdfg's current question (which seems to be around Java FX) then I'll remove it.
    Just give me the nod.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  10. #50
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,389
    Blog Entries
    7
    Rep Power
    25

    Default Re: Is it worth to learn Swing?

    Quote Originally Posted by SurfMan View Post
    I would expect Jos to give him both barrels for hijacking a thread, posting an unrelated crappy unformatted code dump, asking no questions. I mean, I am feeling like I can help Samar out with a nice rant, but maybe a moderator can set things straight, move the code to a new thread, send him a warning and prepare to wave the ban stick.
    Yup, I saw those posts and didn't know what to do with them; I thought banning the poster would be too harsh; the poster is probably a kid that is so proud he could produce or steal the code from somewhere. My idea was to ignore it completely unless it would go on (in which case I would break the posters kneecaps, pull out his intestines, poke his eyes out and put the silly remnants on display ...)

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  11. #51
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    5,739
    Rep Power
    10

    Default Re: Is it worth to learn Swing?

    Yes, I too was talking about Samar's OP. It has nothing to do with asdfg's thread.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  12. #52
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    5,739
    Rep Power
    10

    Default Re: Is it worth to learn Swing?

    Quote Originally Posted by JosAH View Post
    unless it would go on (in which case I would break the posters kneecaps, pull out his intestines, poke his eyes out and put the silly remnants on display ...)
    That's the Jos I know!!! What a relief. I thought you might have had too much Grolsch (if that's even possible).

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  13. #53
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,130
    Rep Power
    23

    Default Re: Is it worth to learn Swing?

    I've shifted them into their own thread...I've left this conversation here to confuse everyone, though.

    Bwah-ha-ha-haaa!
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  14. #54
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    203
    Rep Power
    3

    Default Re: Is it worth to learn Swing?

    Quote Originally Posted by Tolls View Post
    I've shifted them into their own thread...I've left this conversation here to confuse everyone, though.

    Bwah-ha-ha-haaa!
    Thread obfuscation.

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Learn Niche Technology , browse your book now and learn
    By tech-ebooks in forum Reviews / Advertising
    Replies: 10
    Last Post: 11-08-2016, 02:11 PM
  2. What do I need to learn AWT or Swing?
    By kkid in forum AWT / Swing
    Replies: 5
    Last Post: 10-19-2012, 05:53 PM
  3. Replies: 4
    Last Post: 07-17-2010, 10:50 AM
  4. Replies: 0
    Last Post: 08-05-2008, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •