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 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]
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.Button addActionListener addPropertyChangeListener
java.awt.Component addPropertyChangeListener
java.awt.Dimension height width
java.awt.List addActionListener addPropertyChangeListener
java.awt.MenuItem addActionListener
java.awt.TextField addActionListener addPropertyChangeListener
java.awt.TrayIcon addActionListener
javax.swing.AbstractButton addActionListener addChangeListener addPropertyChangeListener
javax.swing.AbstractSpinnerModel addChangeListener
javax.swing.BoundedRangeModel addChangeListener
javax.swing.ButtonModel addActionListener addChangeListener
javax.swing.ComboBoxEditor addActionListener
javax.swing.DefaultButtonModel addActionListener addChangeListener
javax.swing.DefaultSingleSelectionModel addChangeListener
javax.swing.JFileChooser addActionListener addPropertyChangeListener
javax.swing.JFrame addPropertyChangeListener exitOnClose
javax.swing.JMenu addActionListener addChangeListener addPropertyChangeListener checkBoxItem item radioButtonItem
javax.swing.JMenuBar addPropertyChangeListener menu
javax.swing.JPopupMenu addPropertyChangeListener menu
javax.swing.JProgressBar addChangeListener addPropertyChangeListener
javax.swing.JSlider addChangeListener addPropertyChangeListener
javax.swing.JSpinner addChangeListener addPropertyChangeListener
javax.swing.JTextField addActionListener addPropertyChangeListener
javax.swing.JViewport addChangeListener addPropertyChangeListener
javax.swing.MenuSelectionManager addChangeListener
javax.swing.SingleSelectionModel addChangeListener
javax.swing.SpinnerModel addChangeListener
javax.swing.Timer addActionListener
javax.swing.colorchooser.ColorSelectionModel addChangeListener
javax.swing.colorchooser.DefaultColorSelectionModel addChangeListener
javax.swing.text.Caret addChangeListener
javax.swing.text.DefaultCaret addChangeListener
javax.swing.text.Style addChangeListener
javax.swing.text.StyleContext addChangeListener
 

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

actionListener


 fun actionListener(fn: (ActionEvent-> Unit): ActionListener

Creates a ActionListener for the given function for processing each ActionEvent

source

borderPanel


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

button


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

changeListener


 fun changeListener(fn: (ChangeEvent-> Unit): ChangeListener

Creates a ChangeListener for the given function for processing each ChangeEvent

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.