Reputation: 115
I'v extended a JavaFX Label.
public class UpdateLabel extends Label{
private StringProperty updateKeyPrefix = new SimpleStringProperty();
public String getUpdateKeyPrefix(){
return this.updateKeyPrefix.get();
}
public void setUpdateKeyPrefix(String updateKeyPrefix){
this.updateKeyPrefix.set(updateKeyPrefix);
}
private ObjectProperty<Enum<?>> updateKeyEnum = new SimpleObjectProperty<>();
public Enum<?> getUpdateKeyEnum(){
return this.updateKeyEnum.get();
}
public void setUpdateKeyEnum(Enum<?> updateKeyEnum){
this.updateKeyEnum.set(updateKeyEnum);
}
public Update getUpdate(){
return new Update(this.getUpdateKeyEnum(), this.getUpdateKeyPrefix(), null);
}
}
Now when i use it in my fxml I get the following errors:
I can still compile regardless, but when I run it I get this:
Upvotes: 0
Views: 2659
Reputation: 115
Okay found it already: I wasn't extending the correct Label class. (Java.awt instead of the JavaFX one).
Upvotes: 1