hanbin615
hanbin615

Reputation: 595

Translate javafx GUI into fxml

I am new to fxml, at first it seemed easy to use, but when I gave myself an exercise to translate one of the demo on oracle into fxml, and I found myself spending all day on google.

but still I can't find the answer to these two:

btnAdd.setMaxHeight(Control.USE_PREF_SIZE);
btnAdd.setMaxWidth(Double.MAX_VALUE);

if someone know where I can find a tutorial, please share.

Upvotes: 3

Views: 482

Answers (1)

James_D
James_D

Reputation: 209225

Use fx:constant:

<Button fx:id="btnAdd">
    <maxHeight><Control fx:constant="USE_PREF_SIZE" /></maxHeight>
    <maxWidth><Double fx:constant="MAX_VALUE" /></maxWidth>
</Button>

Upvotes: 5

Related Questions