JavaFX Java GUI Tutorial - 28 - Properties

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ธ.ค. 2024

ความคิดเห็น • 27

  • @Gordolone
    @Gordolone 4 ปีที่แล้ว +2

    five years later and still this video explains the concept in an easy understandable and fun way. You're great. Period.

  • @adamadma310
    @adamadma310 3 ปีที่แล้ว

    So similar to how we reffer to objects by their memory addresses, we can reffer to properties of an object (eg. int, string values) with Property. Great tutorial, realy helped me out!

  • @boristhedestroyerofancient508
    @boristhedestroyerofancient508 3 ปีที่แล้ว +1

    I can imagine Bucky clobbering some babies...
    But honestly, tutorials with Bucky are a pleasure to watch and god damn, I haven't laughed that much at a programming tutorial in a long time!
    Keep at it Bucky! And thanks for the video :)

  • @holanankerholden3314
    @holanankerholden3314 8 ปีที่แล้ว

    This tutorial really helped me out. I managed to implement my scene-manager with the properties. Thanks alot! :)

  • @Qornv
    @Qornv 5 ปีที่แล้ว +14

    "String is not an object" well... it is an object..

  • @cipherbenchmarks
    @cipherbenchmarks 5 ปีที่แล้ว +2

    Is this an implementation of the observer pattern ?

  • @ethandx9
    @ethandx9 3 ปีที่แล้ว

    04:57 what do you mean when you say "this refers to the object that contains it - this"? I assume the object that contains it is firstName?

    • @Cecil_Augus
      @Cecil_Augus 2 ปีที่แล้ว +1

      He overcomplicated this part. You can just pass the currently used class as the "this" value.There's no need to create a class and put the Property inside it.

  • @ziddy26
    @ziddy26 8 ปีที่แล้ว +1

    06:40 is it okay to have a method that returns a private instance variable?

    • @ziddy26
      @ziddy26 7 ปีที่แล้ว

      Thanks for the reply. I guess I was thinking of C++. I dont think it is good practice to return reference of private variables through public member functions in C++.

    • @raresconea9174
      @raresconea9174 7 ปีที่แล้ว

      That StringProperty, even if it is private, it is not fully protected because he returns a reference to it within the method firstNameProperty. A copy of that StringProperty would have been suitable but this is not the purpose of this tutorial.

    • @keithscull8288
      @keithscull8288 6 ปีที่แล้ว

      All aforementioned is true, just like to add that returning a private variable via an accessor method, (getter/setter) is one of the main aspects of encapsulation, making variables/data in a class private and only accessible via accessor methods :) 1/5 of the fundamentals of object oriented programming

    • @danielpersson5567
      @danielpersson5567 4 ปีที่แล้ว

      It's bad practice to expose users of the Person class to the property though, if you want to change the implementation of the listener to something else you would have to rewrite all the client code.

  • @sina9378
    @sina9378 3 ปีที่แล้ว

    Great Tutorial! THANKS!

  • @_erayerdin
    @_erayerdin 8 ปีที่แล้ว

    Now, I am wondering if I can use properties to change live from data requested from a RESTful server.

  • @collinalpert701
    @collinalpert701 7 ปีที่แล้ว

    Does this work for more complex datatypes, e.g. java.time.Year?

  • @reggiegorgonio9616
    @reggiegorgonio9616 5 ปีที่แล้ว

    what's the difference between properties and setOn then add event? i know this video is from 2015 and its 2019 but i want to learn

  • @GMByteJavaTM
    @GMByteJavaTM 6 ปีที่แล้ว

    Why not just change the value through the setter?

  • @aniskadri140
    @aniskadri140 2 ปีที่แล้ว

    Merci

  • @HARLANGENEPARROTT
    @HARLANGENEPARROTT 9 ปีที่แล้ว +1

    What program are you using Mr. Roberts?

    • @TheWombatGuru
      @TheWombatGuru 9 ปีที่แล้ว +5

      Gene parrott sr IntelliJ Idea from Jetbrains

  • @plashrz
    @plashrz 9 ปีที่แล้ว

    i use netbeans so this is how netbeans takes care of these properties.
    public class person {
    private StringProperty name = new SimpleStringProperty(this,"name","");
    public String getName() {
    return name.get(); //.get to actually retrieve the value form this property/ which //now acts as an object
    }
    public void setName(String value) {
    name.set(value);//same way here we use these old and familiar get() and set()
    }
    public StringProperty nameProperty() {
    return name;
    }
    }
    ***makes sence

    • @ibouvousaime
      @ibouvousaime 9 ปีที่แล้ว

      +plash razdan IntelliJ helps you create getters and setters easily too