val form : EasyForm = new com.twosigma.beakerx.scala.easyform.EasyForm("Form and Run") form.addTextField("first") form.put("first", "First") form.addTextField("last") form.put("last", "Last") form.addButton("Go!", "run") form "Good morning " + form.get("first") + " " + form.get("last") form.put("first", "Beaker") form.put("last", "Berzelius") //You can use onInit and onChange to handle component events. For button events use actionPerfromed or addAction. val f1 = new EasyForm("Form and Run") val first = f1.addTextField("first", 15) val last = f1.addTextField("last", 15).onInit(new EasyFormListener { override def execute(value: String): Unit = { f1.put("last", "setinit1"); } }).onChange(new EasyFormListener { override def execute(value: String): Unit = { first.setValue(f1.get("last") + " extra"); } }); val button = f1.addButton("action", "action_button") button.actionPerformed = new EasyFormListener { override def execute(value: String): Unit = f1.put("last", "action done"); } f1 f1.get("last") + ", " + f1.get("first") f1.put("last", "new Value") f1.put("first", "new Value2") val g = new EasyForm("Field Types") g.addTextField("Short Text Field", 10) g.addTextField("Text Field") g.addPasswordField("Password Field", 10) g.addTextArea("Text Area") g.addTextArea("Tall Text Area", 10, 5) g.addCheckBox("Check Box") val options = Seq("a", "b", "c", "d") g.addComboBox("Combo Box", options) g.addComboBox("Editable Combo", options, true) g.addList("List", options) g.addList("List Single", options, false) g.addList("List Two Row", options, 2) g.addCheckBoxes("Check Boxes", options) g.addCheckBoxes("Check Boxes H", options, EasyForm.HORIZONTAL) g.addRadioButtons("Radio Buttons", options) g.addRadioButtons("Radio Buttons H", options, EasyForm.HORIZONTAL) g.addDatePicker("Date") g.addButton("Go!", "run2") g import java.util.HashMap import java.util.function.Consumer val result = new HashMap[String, Object]() g.keySet().forEach( new Consumer[String] { override def accept(key: String): Unit = { result.put(key, g.get(key)) } } ) result val gdp = new EasyForm("Field Types") val date = gdp.addDatePicker("Date") gdp gdp.get("Date") import java.util.Date val easyForm = new EasyForm("Field Types") // Setup date via String (format is yyyyMMdd) also works easyForm.addDatePicker("Date").setDate(new Date()) easyForm val h = new EasyForm("Default Values") h.addTextArea("Default Value", "Initial value") h.addCheckBox("Default Checked", true) h.addButton("Press", "check") h val result = new HashMap[String, Object]() h.keySet().forEach( new Consumer[String] { override def accept(key: String): Unit = { result.put(key, h.get(key)) } } ) result import com.twosigma.beakerx.widget.IntSlider val w = new IntSlider() val widgetForm = new EasyForm("pyhton widgets") widgetForm.addButton("Press", "widget_test") widgetForm.addWidget("IntSlider",w) widgetForm widgetForm.get("IntSlider")