use of com.codename1.components.RadioButtonList in project CodenameOne by codenameone.
the class SheetSample method start.
public void start() {
if (current != null) {
current.show();
return;
}
Form hi = new Form("Hi World", new BorderLayout());
RadioButtonList sheetPos = new RadioButtonList(new DefaultListModel(BorderLayout.NORTH, BorderLayout.EAST, BorderLayout.SOUTH, BorderLayout.WEST, BorderLayout.CENTER));
Button b = new Button("Open Sheet");
b.addActionListener(e -> {
MySheet sheet = new MySheet(null);
int positionIndex = sheetPos.getModel().getSelectedIndex();
if (positionIndex >= 0) {
String pos = (String) sheetPos.getModel().getItemAt(positionIndex);
sheet.setPosition(pos);
}
sheet.show();
});
hi.add(BorderLayout.NORTH, BoxLayout.encloseY(sheetPos, b));
hi.show();
}
Aggregations