If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
Desktop OS Windows 10 Pro
Simulator Latest
Device PC, Android, IOS
I have a BorderLayout Dialog, 2 com.codename1.ui.table.TableLayout(rows, 1) Containers
First Container has 20 rows of Label("some text) and is set as
dlg.add(BorderLayout.NORTH,ContainerDataBaseContainer);
And An Options Container set as
dlg.add(BorderLayout.SOUTH,OptionsContainer);
Scrolling is set true for ContainerDataBaseContainer
When Running demo, ContainerDataBaseContainer consumes 100% of the frame and overlaps OptionsContainer Container
VS Always showing
OptionsContainer at Bottom and the ContainerDataBaseContainer scrolls between top and OptionsContainer
Please see attached pics BorderLayoutScrollPic1.JPG , BorderLayoutScrollPic2.JPG& BorderLayoutScrollPic3.JPG
Pic one shows when app first opened,
Pic two shoes app when Top container is scrolled.
Pic Three shows correct scrolling between Top header and bottom options container
Here is the demo code:
----------------------------------------------------------------------------------------------
Dialog dlg = new Dialog("A3-Tech Customer Search");
try {
int rows = 20;
dlg.setLayout(new BorderLayout());
Container ContainerDataBaseContainer = new Container(new com.codename1.ui.table.TableLayout(rows, 1));
ContainerDataBaseContainer.setScrollableY(true);
for (int a = 0; a < rows; a++) {
buildConstrantsGeneric(ContainerDataBaseContainer, new Label("Label Row [" + (a + 1) + "]"), a, 0, 100);
}
Container OptionsContainer = new Container(new com.codename1.ui.table.TableLayout(1, 3));
Button CmdCancel = new Button("Cancel", "Button");
CmdCancel.addActionListener(e -> {
dlg.dispose();
});
Button ExecSearch = new Button("Execute Search", "Button");
ExecSearch.addActionListener(e -> {
dlg.dispose();
});
Button OpenRos = new Button("Load Open Invoices", "Button");
OpenRos.addActionListener(e -> {
dlg.dispose();
});
buildConstrantsGeneric(OptionsContainer, OpenRos, 0, 0, 33);
buildConstrantsGeneric(OptionsContainer, ExecSearch, 0, 1, 33);
buildConstrantsGeneric(OptionsContainer, CmdCancel, 0, 2, 34);
dlg.add(BorderLayout.NORTH, ContainerDataBaseContainer);
dlg.add(BorderLayout.SOUTH, OptionsContainer);
} catch (Exception e) {
e.printStackTrace();
}
dlg.show(0, 0, 0, 0);
public static TableLayout.Constraint buildConstrantsGeneric(Container CTR, Component comp, int row, int col, int widthPercent) {
TableLayout.Constraint ConSt = ((TableLayout) CTR.getLayout()).createConstraint(row, col);
ConSt.setWidthPercentage(widthPercent);
CTR.addComponent(ConSt, comp);
return ConSt;
}
Regards