|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||||
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 |
actionListener(fn: (ActionEvent) -> Unit): ActionListener
Creates a ActionListener for the given function for processing each ActionEvent |
|
fun |
borderPanel(init: (JPanel) -> Unit): JPanel
|
|
fun |
button(text: String, action: (ActionEvent) -> Unit): JButton
|
|
fun |
changeListener(fn: (ChangeEvent) -> Unit): ChangeListener
Creates a ChangeListener for the given function for processing each ChangeEvent |
|
fun |
checkBoxMenuItem(text: String, [description: String, mnemonic: Char, accelerator: KeyStroke]): JCheckBoxMenuItem
Helper method to create a new [JCheckBoxMenuItem] |
|
|
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] |
|
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
| Function Detail |
|---|
fun action(text: String, [description: String, mnemonic: Int, icon: Icon], fn: (ActionEvent) -> Unit): Action
Helper method to create an action from a function
fun actionListener(fn: (ActionEvent) -> Unit): ActionListener
Creates a ActionListener for the given function for processing each ActionEvent
fun changeListener(fn: (ChangeEvent) -> Unit): ChangeListener
Creates a ChangeListener for the given function for processing each ChangeEvent
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 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 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]
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||