Class fvaswing.utils.FvUIUtil

Description

Basic methods to help AsWing UI construction.

Method Index

createActionListeneableTextField(), createButton(), createLabel(), createLabelComponentLine(), createLabelInputLine(), createLabelWidth(), createListeneableTextArea(), createListeneableTextField(), createTiledBorder(), createTiledPanel()

Method Detail

createTiledPanel

static public function createTiledPanel(caption:String, margin:Number):JPanel

Creates a new JPanel with TiledBorder

createTiledBorder

static public function createTiledBorder(caption:String, margin:Number):Border

Creates a tiled border.

createButton

static public function createButton(caption:String, icon:Icon):JButton

Creates and returns new JButton using passed-in arguments.

Parameters

captionButton's label.
iconButton's icon

createLabel

static public function createLabel(caption:String):JLabel

Creates and returns a JLabel with passed-in caption

Horizontal alignment is set to JLabel.LEFT

createLabelWidth

static public function createLabelWidth(width:Number, caption:String):JLabel

Creates and returns a JLabel with passed-in caption

Horizontal alignment is set to JLabel.LEFT

createListeneableTextField

static public function createListeneableTextField(func:Function, context):JTextField

Creates and returns new JTextField with text change listener.

Parameters

funcHandler to call when text change
contextHandler scope

createListeneableTextArea

static public function createListeneableTextArea(func:Function, context):JTextArea

Creates and returns new JTextArea with text change listener.

Parameters

funcHandler to call when text change
contextHandler scope

createActionListeneableTextField

static public function createActionListeneableTextField(func:Function, context):JTextField

Creates and returns new JTextField with text actions listener.

Change event is broadcasted only when user press Enter button or when textfield loose focus.

Use createListeneableTextField() method to listen text change event.

Parameters

funcHandler to call when text change
contextHandler scope

createLabelInputLine

static public function createLabelInputLine(label:JLabel, input:JTextComponent):JPanel

Creates and returns a JPanel ( BorderLayout ) with a JLabel on BorderLayout.LEFT and a JTextComponent on BorderLayout.CENTER

createLabelComponentLine

static public function createLabelComponentLine(label:JLabel, component:Component):JPanel

Creates and returns a JPanel ( BorderLayout ) with a JLabel on BorderLayout.LEFT and a Component on BorderLayout.CENTER