I have a JComboBox
which is has values No
& Yes
. This is how I store it into database:
jdto.setPlacement("Yes".equals(comboPlace.getSelectedItem()));
then pass the jdto
into my create method. Selecting yes gives value true. I am struggling to work in reverse logic now.
I want to be able to automatically fill combobox with Yes or No
depending on true/false value from database.
atm I have the following
fieldPlace.setSelectedItem(jdto.getPlacement());
I tried if else statement with string but was unable to do so.
can someone demonstrate how to achieve this.
this is getPlacement()
public Boolean getPlacement() {
return placement;
}