在图中,setText()方法前并没有标明调用对象,但是点进去发现这是Label对象调用的,并非是文本对象调用的。请问为何?
javafx.scene.control.Labeled是javafx.scene.control.TreeCell的父类。
setText是从javafx.scene.control.Labeled类继承下来的方法, 函数说明如下:
public final void setText(String value)
Sets the value of the property text.
Property description:
The text to display in the label. The text may be null.