diff --git a/samples/component/SampleGUI.java b/samples/component/SampleGUI.java index 80ad49d98f..5ad6dd4f8f 100644 --- a/samples/component/SampleGUI.java +++ b/samples/component/SampleGUI.java @@ -164,6 +164,17 @@ public static void main(final String[] args) throws IOException { buttonBuilder.setText("Button On A Layer"); buttonBuilder.setPosition(0, 0); + buttonBuilder.setOnClickFunction(() -> { + final Layer tmp = new Layer(new Dimension(5, 5), new Point(0, 1)); + + final ButtonBuilder bb = new ButtonBuilder(); + bb.setText("Click"); + bb.setPosition(0, 0); + bb.setOnClickFunction(() -> System.out.println("Yee")); + + tmp.addComponent(bb.build()); + buttonLayer.addComponent(tmp); + }); buttonLayer.addComponent(buttonBuilder.build()); layer.addComponent(buttonLayer);