I think that the problem is somewhere else as using new constraints did not
help any
TableLayout layout = new TableLayout(4,4);
private Label lblVersion = new Label();
private Label lblEmployee = new Label();
Picker cmbTheme = new Picker();
private Container cnt1 = new Container(layout);
Button btnSave = new Button("Save",
FontImage.createMaterial(FontImage.MATERIAL_FOLDER,
UIManager.getInstance().getComponentStyle("Command")));
protected void initManualComponents() {
cmbTheme.setType(Display.PICKER_TYPE_STRINGS);
cmbTheme.setStrings("Native", "Blue", "Chrome", "Dark", "Green");
lblVersion.setText(GLOBALS.version);
lblEmployee.setText(GLOBALS.employee.toString());
btnSave.addActionListener(e -> onSave());
layout.setGrowHorizontally(true);
cnt1.add(layout.createConstraint().horizontalSpan(1), new
Label("Version:"));
cnt1.add(layout.createConstraint().horizontalSpan(3), lblVersion);
cnt1.add(layout.createConstraint().horizontalSpan(1), new
Label("Employee:"));
cnt1.add(layout.createConstraint().horizontalSpan(3), lblEmployee);
cnt1.add(layout.createConstraint().horizontalSpan(1), new Label("Theme:"));
cnt1.add(layout.createConstraint().horizontalSpan(3), cmbTheme);
cnt1.add(layout.createConstraint().horizontalSpan(4), new Label("Note:
Theme changes require a restart"));
cnt1.add(layout.createConstraint().horizontalSpan(2), btnSave);
this.add(BorderLayout.CENTER, cnt1);
}
On Monday, July 18, 2016 at 9:18:16 PM UTC-7, Shai Almog wrote:
>
> You can't reuse a constraint for two separate components. We should
> probably detect and fail on such cases.
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/2d9ffc30-9aa8-4f84-8729-84a68b0b4b30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.