use of com.codename1.components.SplitPane in project CodenameOne by codenameone.
the class SharedJavascriptContextSample method start.
public void start() {
if (current != null) {
current.show();
return;
}
Form hi = new Form("Hi World", new BorderLayout());
TextArea input = new TextArea();
TextArea output = new TextArea();
output.setEditable(false);
Button execute = new Button("Run");
execute.addActionListener(evt -> {
BrowserComponent bc = CN.getSharedJavascriptContext().ready().get();
bc.execute("callback.onSuccess(window.eval(${0}))", new Object[] { input.getText() }, res -> {
output.setText(res.toString());
});
});
SplitPane split = new SplitPane(SplitPane.VERTICAL_SPLIT, input, output, "0", "50%", "99%");
hi.add(CENTER, split);
hi.add(NORTH, execute);
hi.show();
}
Aggregations