atlantafx
atlantafx copied to clipboard
ComboBox items are shown in wrong position when they are above ComboBox
Run the following code:
public class JavaFxTest7 extends Application {
@Override
public void start(Stage stage) {
Application.setUserAgentStylesheet(new Dracula().getUserAgentStylesheet());
var items = FXCollections.observableArrayList(List.of("a", "b"));
var combobox = new ComboBox<String>();
combobox.setItems(items);
var vBox = new VBox(combobox);
vBox.setStyle("-fx-font-size: 15");
vBox.setAlignment(Pos.BOTTOM_LEFT);
Scene scene = new Scene(vBox, 600, 200);
stage.setScene(scene);
stage.show();
stage.setMaximized(true);
}
public static void main(String[] args) {
launch();
}
}
And you will get this result:
As you see when you click it the fist time, then there is a space between the comboBox and items. The size of this space depends on the font size. At the same time, when you click the second time, then there is no such space.
When I use pure JavaFX (without atlantafx), then everything is OK: