Tutorial by Examples

Builders can be defined as a set of extension functions taking lambda expressions with receivers as arguments. In this example, a menu of a JFrame is being built: import javax.swing.* fun JFrame.menuBar(init: JMenuBar.() -> Unit) { val menuBar = JMenuBar() menuBar.init() setJMe...

Page 1 of 1