You couldn’t prompt how to fill the
right field in TwinColSelect by analogy -
...
TwinColSelect l = new TwinColSelect();
for (int i = 0; i < cities.length; i++) {
l.addItem(cities[i]
);
}
private static final String[] cities = new String[]
{ ... };
...
The right column contains the selected items, so you can set it with setValue().
TwinColSelect l = new TwinColSelect();
for (int i = 0; i < cities.length; i++)
l.addItem(cities[i]
);
Set<String> selection = new HashSet<String>();
selection.add("Turku");
selection.add("Paris");
l.setValue(selection);