Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
import groovyx.javafx.GroovyFX
import groovyx.javafx.SceneGraphBuilder


def url = "http://www.yahoo.com";
GroovyFX.start({
    def sg = new SceneGraphBuilder();

    def webEngine = sg.webEngine(location: url);
    def goAction = { webEngine.load(urlBox.getText()) };
    def stage = sg.stage(
        title: "HTML Editor (Groovy)",
        visible: true,
    ) {
        scene(fill: hsb(128, 0.5, 0.5, 0.5), width: 400, height:400 ) {
        borderPane     borderPane() {
                html = htmlEditor()
                bottom(align: "center", margin: [10,0]) {
                    button(text: "Print HTML", onAction: { println html.htmlText})
                }
            }
        }
    }
});