Package kotlin.swing

Swing API (in kotlin-swing module)

See:
          Description

Function Summary
fun action(text: String, [description: String, mnemonic: Int, icon: Icon], fn: (ActionEvent-> Unit): Action
Helper method to create an action from a function
fun borderPanel(init: (JPanel-> Unit): JPanel
fun button(text: String, action: (ActionEvent-> Unit): JButton
fun checkBoxMenuItem(text: String, [description: String, mnemonic: Char, accelerator: KeyStroke]): JCheckBoxMenuItem
Helper method to create a new [JCheckBoxMenuItem]
fun <T>
configureMenuItem(answer: T, description: String, mnemonic: Char, accelerator: KeyStroke): T
Helper method to create a new [JMenuItem]
fun frame(title: String, init: (JFrame-> Unit): JFrame
fun gridBagContraints( [gridx: Int, gridy: Int, fill: Int, anchor: Int, gridwidth: Int, gridheight: Int, weightx: Double, weighty: Double]): GridBagConstraints
Helper function to create a [GridBagConstraints]
fun keyStroke(keyChar: Char, modifiers: Int): KeyStroke
Helper function to create a [KeyStroke]
fun menuBar(init: (JMenuBar-> Unit): JMenuBar
Creates a [JMenuBar] from a list of [JMenu] objects
fun menuItem(text: String, [description: String, mnemonic: Char, accelerator: KeyStroke]): JMenuItem
Helper method to create a new [JMenuItem]
fun panel(init: (JPanel-> Unit): JPanel
fun popupMenu(init: (JPopupMenu-> Unit): JPopupMenu
Creates a [JPopupMenu] from a list of [JMenu] objects
fun radioButtonMenuItem(text: String, [description: String, mnemonic: Char, accelerator: KeyStroke]): JRadioButtonMenuItem
Helper method to create a new [JRadioButtonMenuItem]
 

Extensions Summary
java.awt.Dimension height width
javax.swing.JFrame exitOnClose
javax.swing.JMenu checkBoxItem item radioButtonItem
javax.swing.JMenuBar menu
javax.swing.JPopupMenu menu
 

Package kotlin.swing Description

Kotlin Swing

The Kotlin Swing library provides some helper functions and extensions for creating Swing user interfaces.

To try the sample run

cd kotlin/libraries/kotlin-swing
mvn test -Pui

Or browse the source of the sample
to see the kinds of features available

Contents

Function Detail
source

action


 fun action(text: String,  [description: String, mnemonic: Int, icon: Icon], fn: (ActionEvent-> Unit): Action

Helper method to create an action from a function

source

borderPanel


 fun borderPanel(init: (JPanel-> Unit): JPanel
source

button


 fun button(text: String, action: (ActionEvent-> Unit): JButton
source

checkBoxMenuItem


 fun checkBoxMenuItem(text: String,  [description: String, mnemonic: Char, accelerator: KeyStroke]): JCheckBoxMenuItem

Helper method to create a new [JCheckBoxMenuItem]

source

configureMenuItem


 fun <T> configureMenuItem(answer: T, description: String, mnemonic: Char, accelerator: KeyStroke): T

Helper method to create a new [JMenuItem]

source

frame


 fun frame(title: String, init: (JFrame-> Unit): JFrame
source

gridBagContraints


 fun gridBagContraints( [gridx: Int, gridy: Int, fill: Int, anchor: Int, gridwidth: Int, gridheight: Int, weightx: Double, weighty: Double]): GridBagConstraints

Helper function to create a [GridBagConstraints]

source

keyStroke


 fun keyStroke(keyChar: Char, modifiers: Int): KeyStroke

Helper function to create a [KeyStroke]

source

menuBar


 fun menuBar(init: (JMenuBar-> Unit): JMenuBar

Creates a [JMenuBar] from a list of [JMenu] objects

source

menuItem


 fun menuItem(text: String,  [description: String, mnemonic: Char, accelerator: KeyStroke]): JMenuItem

Helper method to create a new [JMenuItem]

source

panel


 fun panel(init: (JPanel-> Unit): JPanel
source

popupMenu


 fun popupMenu(init: (JPopupMenu-> Unit): JPopupMenu

Creates a [JPopupMenu] from a list of [JMenu] objects

source

radioButtonMenuItem


 fun radioButtonMenuItem(text: String,  [description: String, mnemonic: Char, accelerator: KeyStroke]): JRadioButtonMenuItem

Helper method to create a new [JRadioButtonMenuItem]



Copyright © 2010-2012. All Rights Reserved.