I don't know how to set a button(or textfield) to expand to the whole space or shrink to minimal width of the button in a table-layout. For example:
TableLayout tl = new TableLayout(1,2);
Container Cnt = new Container(tl);
add(Cnt);
Button searchBtn = new Button("Expand or Shrink");
Cnt.add(tl.createConstraint().widthPercentage(80),searchBtn);
Sometimes searchBtn would expand to the whole space(80 percent of container's width), but others would shrink to the minimum width of searchBtn in a table-layout.
How do I expand or shrink a button in a table-layout as I wish?
And the expanding and shrinking rules of a button for in a BoxLayout.