Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX: Expand a ComboBox programmatically

Does anyone know how to expand a ComboBox by code? I know that in C# we can do this by comboBox1.DroppedDown = true;, but how do I do this in JavaFX?

like image 793
Tengyu Liu Avatar asked Jun 04 '15 07:06

Tengyu Liu


Video Answer


1 Answers

After your stage is visible, simply use :

comboBox.show();

If you want to add a event, before the stage is visible, you may use :

primaryStage.setOnShown(event -> comboBox.show());
like image 178
ItachiUchiha Avatar answered Nov 04 '22 11:11

ItachiUchiha