 So now we get into this concept known as binding, which to begin with is going to be a little kind of confusing. But the idea behind it is if we've thought about working with objects or just data in general, if I came in here and I said x equals 5, y equals 10 times x. Well what's y? Y is 50. Now what is y if x changes to 7? Well y is still 50 because I said it beforehand. This is a procedural language. Now binding what it does is it says well when this guy would change, make this change as well. And so the idea is we have a few terms. We have something called my target and my source. So again I was saying that if x changes I want to change y. So I would come in here and I'd say y dot bind x. Now what do I want to happen? Well I not just want x to do its normal thing because we can't just do this with normal numbers. We actually have to get into sort of numerical property classes. And these are a little goofy but these are no different than when we had to come in and we made something like double d equals new double. We're doing the exact same thing. The only difference now is instead of double d we're actually going to be using something called in this case double property. So it becomes double property x equals new double property and we can still use that 5. Now assume I've gone ahead and done the exact same for y. I don't really have the space but then I can come in here and I can say well y is this. And then I can come in and say x dot multiply 10. Now what happens with this? This is basically again this is where the confusion starts to occur. Take a deep breath in, pause it, maybe plug this in, see what happens. So what's going on is again when x changes y is going to change. How is y going to change? y is going to change by multiplying x by 10 and then setting that equal to now y. Y again is still, y is not just an integer, it's not just a double, it's also a double property. So kind of let's see this in practice. Again I've got some variables I can work with and I'll go ahead and pop this into Eclipse. And so not inheriting from anything but we are dealing with binding. So boom boom boom, finish this guy up. So again we're dealing now with the fact that we're dealing with properties. And for our example we'll use a double property, double property. We'll still use x, we'll still say x equals new double property and we said 5. Now okay, where does this import from? Again everything imports nowadays. It actually imports from Java FX but it imports from double, okay let's see, I don't have a typo. Simple double property, there we are and let me import that as well. There we go, double property is an abstract method or class so you can't just make it. So I've made double property x equals simple double property. I'm going to come in here and then I'm going to say y is going to equal x times, well not just x, it's going to equal 5 times 10. In fact you know what, I'm not going to give it anything. I think that would be more confusing. So then on top of that I'm going to go in afterwards and say y bind x dot multiply. Notice I'm seeing these things as they appear. I'm going to specify a multiple 10. And so now what should happen is if I then in turn do a system dot out dot print ln x plus x dot get value which will show me the value of x plus y, y dot get value. There we are. And so again I've run this. You're going to see that when I change x to 5, y is bound by 5 or bound to x. So when x is, whatever x is, y is explicitly going to be 5 bigger than it or 10 times bigger than that. So let's change it. Let's actually come in here now and then I'm going to just, I'm going to come in here and I'm going to say change x to a set value. I'm going to change it now instead of it being 5, I'm going to change it to 7 just like we did inside of our little example because what we should see happen is not only does x change from 5 to 7, y changes from 50 to 7d. Now, why would this be beneficial? Well, again, you know, okay, y changes. So I don't have to constantly be reevaluating what y is. Also, now that we're dealing with GUIs for example, this, okay, not too fantastic but now we get into something about taking a lot of the GUI components that are already pre-built and applying that same binding technique. Say for example, we made a circle. Here's a circle that we could design. Circles have a center, a center x and a center y. Well, guess what? I probably want to have that center be, you know, if I resize my window I want my center to stay the same. So what I would do is I'd be utilizing the property. Now, almost all the nodes inside of Java, Java FX specifically they all have these properties for the variables of them. So they happen, you know, reflexively. Again, this is saying that this is my target and whenever my pain changes, whenever my pain changes I want my circle to change to half of whatever the pain property, the pain's width is. Again, that's where we see notice pain.width property is exactly that. So let's put that into practice now. I come in here, I'm going to get rid of my buttons. I don't care about my buttons anymore, sorry buttons. I'm going to make a circle. Circle C equals new circle. I'm not going to give it anything but I am going to import it. And add it to my panel. Now, right now, if I run this, I get nothing. I literally get nothing because my circle is really tiny. However, if I do C dot set radius, oh, by default it's zero. So if I change it to say 10, all right. Now what we should see is, oh, well, it's hanging out over there in the very kind of like top corner. That's not that great. However, again, we now know that we have some functions that allow us to kind of work with it. Again, if we look at the slide, I said that we had a center X and a center Y we were dealing with. Well, if I have those variable, I probably have setters for them such as setCenterX. And we're going to go ahead and just say make it start at 50. And I'm going to do the exact same thing for my Y. Now, again, that gives me a black square, a black circle at 50, 50. And all right, now, again, if I run this, if I resize my window, notice it stays the exact same spot. It doesn't change. Now I want it to actually kind of reflexively change as well. So instead of doing this set here and this set here, what I'm going to go ahead and do is I'm going to come in right after I've made my pane. And I'm going to say circle.centerXProperty.vind. Now remember that dot bind that says when something inside here changes, change this property to reflexively also change. Again, I have a pane now and a pane has other properties such as a width property that I want to then in turn take in. I want to divide by two. I want to divide it in half. So what happens is now my circle, that's to be C, my circles, centerX, where my circle is going to be, is now going to be reflexively, respectively, at the center of my panel because I grabbed the panels width and divided by two. As you can guess, if I can do that with X and width, I can do that again with Y and height. And so now when I run this, what's going to happen is my circle appears in the center and if I resize the width because I've bound my centerX of my circle to respectively change whenever my panels, my panes with changes, it's going to change. And whenever I change my height because I respectively have it bound to it, I can redo it this way as well.