0
我想创建一个窗格,向用户显示类似于here(带有X解除按钮的那个)的典型引导警报样式的警报。如何使用JavaFX创建“引导”式警报
到目前为止,我已经尝试过使用一个gridpane,并且它不是太糟糕。但是我对结果并不满意,特别是当我添加更多文本时。
<GridPane minHeight="40" maxHeight = "40">
<VBox fx:id="MessageVbox" alignment="BASELINE_LEFT" GridPane.columnIndex="0" GridPane.rowIndex="0">
<Label fx:id="Message" text="Alert Message" />
<padding>
<Insets bottom="5.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox>
<Button fx:id="Dismiss" alignment="TOP_RIGHT" onAction="#handleDismiss" text="X" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0"
percentWidth="90.0" prefWidth="100.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES"
minWidth="10.0" percentWidth="10.0" prefWidth="100.0" />
</columnConstraints>
</GridPane>
这可能是对你有所帮助:http://stackoverflow.com/questions/21268062/bootstrap-with-javafx –