1 回答

TA貢獻(xiàn)1873條經(jīng)驗(yàn) 獲得超9個(gè)贊
我正在粘貼某人解決的解決方案,但答案已被刪除。而不是創(chuàng)建HBox應(yīng)該使用這個(gè)關(guān)鍵字:
public class VInputText extends HBox {
private FontAwesomeIconView icon;
private TextField textField;
private Label label;
public VInputText(double spacing) {
this.setSpacing(spacing);
this.setAlignment(Pos.CENTER_LEFT);
this.setPrefSize(Control.USE_COMPUTED_SIZE, Control.USE_COMPUTED_SIZE);
icon = new FontAwesomeIconView();
icon.setGlyphName("TIMES");
icon.setSize("1.3em");
textField = new TextField();
label = new Label("<- my validated field");
this.getChildren().addAll(icon, textField, label);
}
}
添加回答
舉報(bào)