can someone please let me know why I cannot place 2 EditFields side by side with the following code? I can place 3 buttons side by side, but for some reason I cannot get the EditFields to work for me. Any help will be appreciated.
//Bin Height
HorizontalFieldManager hManagerBinHeight = new HorizontalFieldManager(FIELD_BOTTOM);
LabelField lblRadiusOfBin = new LabelField("Radius of Bin: ", LabelField.FIELD_LEFT);
EditField txtRadiusFeet = new EditField("Feet: ", "", 3, BasicEditField.FILTER_NUMERIC);
EditField txtRadiusInches = new EditField("Inches: ", "", 2, BasicEditField.FILTER_NUMERIC);
hManagerBinHeight.add(lblRadiusOfBin);
hManagerBinHeight.add(txtRadiusFeet);
hManagerBinHeight.add(txtRadiusInches);
add(hManagerBinHeight);
EditField
s by default consume all available width passed to them during layout. As a result, the available width left for the second EditField is 0. In order to layout them side by side, you have to either:sublayout()
method (orlayout()
in case ofManager
).layout()
method and make it consume a fixed width and not all width.OPTION 1:
OPTION 2:
Result