protected class DLGTest extends Dialog {
protected Button btnApply = new Button(FontImage.createMaterial(FontImage.MATERIAL_DONE, UIManager.getInstance().getComponentStyle("Command"), 5));
protected Button btnClose = new Button(FontImage.createMaterial(FontImage.MATERIAL_CLEAR, UIManager.getInstance().getComponentStyle("Command"), 5));
protected TextField tfLine1 = new TextField();
protected TextArea taNotes = new TextArea();
protected CheckBox cbStudy = new CheckBox();
protected TextField tfMaterial = new TextField();
public DLGTest() {
taNotes.setRows(5);
this.setLayout(new BorderLayout());
this.setScrollableY(true);
btnApply.setUIID("Label");
btnClose.setUIID("Label");
btnApply.addActionListener(evt -> dispose());
btnClose.addActionListener(evt -> dispose());
Container cntButtons = new Container(new FlowLayout(RIGHT));
cntButtons.add(btnApply);
cntButtons.add(btnClose);
TableLayout tl = new TableLayout(1,2);
Container cnt2 = new Container(tl);
cnt2.add(tl.createConstraint().horizontalSpan(1).widthPercentage(25), new Label());
cnt2.add(tl.createConstraint().horizontalSpan(1).widthPercentage(75), new Label());
cnt2.add(tl.createConstraint().horizontalSpan(1), new Label("Line 1"));
cnt2.add(tl.createConstraint().horizontalSpan(1), tfLine1);
cnt2.add(tl.createConstraint().horizontalSpan(1), new Label("Material"));
cnt2.add(tl.createConstraint().horizontalSpan(1), tfMaterial);
cnt2.add(tl.createConstraint().horizontalSpan(1), new Label("Study"));
cnt2.add(tl.createConstraint().horizontalSpan(1).horizontalAlign(Component.LEFT), cbStudy);
cnt2.add(tl.createConstraint().horizontalSpan(1), new Label("Notes"));
Container cnt1 = new Container(new BorderLayout());
cnt1.add(BorderLayout.NORTH, cnt2);
cnt1.add(BorderLayout.CENTER, taNotes);
cnt1.setScrollableY(true);
this.add(BorderLayout.NORTH, cntButtons);
this.add(BorderLayout.CENTER, cnt1);
}
}
new DLGTest().show(20, (int)(Display.getInstance().getDisplayHeight()*.7)-20, 10, 10, true, true);