PDA

View Full Version : Add LabelValueComboBox and EnumComboBox classes



yopiyop
29 Aug 2008, 1:31 AM
like SimpleComboBox

thx.David

gslender
29 Aug 2008, 3:50 AM
you don't need to - you can just add Enum to SimpleComboBox if you add a toString method to your Enum...



public enum DepdType {
CHILD("Child"), PARTNER("Partner"), FRIEND("Friend"), PET("Pet"), FAMILY("Family");

private String name;

DepdType(String name) {
this.name = name;
}

public String toString() {
return name;
}
}

SimpleComboBox combo = new SimpleComboBox<DepdType>();
depdTypeFlds[n].add(DepdType.CHILD);
depdTypeFlds[n].add(DepdType.FAMILY);
depdTypeFlds[n].add(DepdType.FRIEND);
depdTypeFlds[n].add(DepdType.PARTNER);
depdTypeFlds[n].add(DepdType.PET);

yopiyop
29 Aug 2008, 6:59 AM
exact :)

thx a lot.