-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I am creating a combo box as follows :
@Wire
private Combobox cbxBandejaFavoritos;
final List<String> favoritos = Arrays.asList("Fav1","Fav2","Fav3","Fav4","Fav5");
this.cbxBandejaFavoritos.setModel(new SimpleListModel<String>(favoritos));
But not to establish a selected value , how I can set a selected value ? For example , display the value selected "Fav4"
Thanks.
Try this :
final List<String> favoritos = Arrays.asList("Fav1","Fav2","Fav3","Fav4","Fav5");
ListModelList<String> model = new SimpleListModel<String>(favoritos);
model.addToSelection("Fav4);
this.cbxBandejaFavoritos.setModel(model);
Thank you very much,
I tried it and it worked fine!
bye
Asked: 2015-06-01 11:24:51 +0800
Seen: 34 times
Last updated: Jun 02 '15