I have a number of swipeable containers added to a page. The swipeable containers have buttons left and right and the top component is a multibutton that takes the user to another page. When the user goes back to the page with the swipeable containers and swipes left (only left) on a different swipeable container then the first container also opens to the left. Images and sample code below:-
//Swipeable containers bugs
public void SwipeableContainerPage(Form mainForm){
Form formSC = new Form("Swipeable Container", new BorderLayout());
formSC.getToolbar().setBackCommand("", e -> mainForm.showBack());
Container northcnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
Container centercnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
Container southcnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
MultiButton mb_1 = new MultiButton("MB1");
Button b_l1 = new Button("LB1");
Button b_r1 = new Button("RB1");
MultiButton mb_2 = new MultiButton("MB2");
Button b_l2 = new Button("LB2");
Button b_r2 = new Button("RB2");
MultiButton mb_3 = new MultiButton("MB3");
Button b_l3 = new Button("LB3");
Button b_r3 = new Button("RB3");
SwipeableContainer sc_1 = new SwipeableContainer(b_l1, b_r1, mb_1);
SwipeableContainer sc_2 = new SwipeableContainer(b_l2, b_r2, mb_2);
SwipeableContainer sc_3 = new SwipeableContainer(b_l3, b_r3, mb_3);
mb_1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GoToAndBackPage(formSC);
}
});
mb_2.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GoToAndBackPage(formSC);
}
});
mb_3.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GoToAndBackPage(formSC);
}
});
centercnt.add(sc_1);
centercnt.add(sc_2);
centercnt.add(sc_3);
formSC.add(BorderLayout.NORTH, northcnt).add(BorderLayout.CENTER, centercnt).add(BorderLayout.SOUTH, southcnt);
formSC.show();
}
//page for SC to go to
public void GoToAndBackPage(Form mainForm){
Form formGoTo = new Form("Go To Page", new BorderLayout());
formGoTo.getToolbar().setBackCommand("", e -> mainForm.showBack());
Container northcnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
Container centercnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
Container southcnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
Label l_welcome = new Label("Welcome to the Go To Page");
centercnt.add(l_welcome);
formGoTo.add(BorderLayout.NORTH, northcnt).add(BorderLayout.CENTER, centercnt).add(BorderLayout.SOUTH, southcnt);
formGoTo.show();
}


