Class org.aswing.JToolBar

Description

JToolBar provides a component that is useful for displaying commonly used Actions or controls.

JToolBar will change buttons's isOpaque() method, so if your programe's logic is related to button's opaque, take care to add buttons to JToolBar.

With most look and feels, the user can drag out a tool bar into a separate window (unless the floatable property is set to false). For drag-out to work correctly, it is recommended that you add JToolBar instances to one of the four "sides" of a container whose layout manager is a BorderLayout, and do not add children to any of the other four "sides".

Field Index

HORIZONTAL, VERTICAL

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Method Index

new JToolBar()
getMargin(), getOrientation(), getUIClassID(), isFloatable(), setFloatable(), setMargin(), setOrientation(), setUI(), updateUI()

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JToolBar

public function JToolBar(title:String, orientation:Number)

JToolBar(title:String, orientation:Number)
JToolBar(title:String)
default orientation to HORIZONTAL JToolBar()
default title to null, orientation to HORIZONTAL

Creates a new tool bar with a specified title and orientation. title is only shown when the tool bar is undocked.

Parameters

titlethe title of the tool bar
orientationorientation the initial orientation -- it must be either HORIZONTAL or VERTICAL

Field Detail

HORIZONTAL

static public HORIZONTAL:Number

VERTICAL

static public VERTICAL:Number

Method Detail

updateUI

public function updateUI():Void

Description copied from Component

Resets the UI property to a value from the current look and feel. Component subclasses must override this method like this:

   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

Overrides

updateUI() in org.aswing.Component

setUI

public function setUI(newUI:ToolBarUI):Void

Description copied from Component

Sets the look and feel delegate for this component. Component subclasses generally override this method to narrow the argument type. For example, in JSlider:

 public void setUI(SliderUI newUI) {
     super.setUI(newUI);
 }
  

Additionally Component subclasses must provide a getUI method that returns the correct type. For example:

 public SliderUI getUI() {
     return (SliderUI)ui;
 }
 

Overrides

setUI() in org.aswing.Component

getUIClassID

public function getUIClassID():String

Description copied from Component

Returns the UIDefaults key used to look up the name of the org.aswing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of Component that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Overrides

getUIClassID() in org.aswing.Component

setMargin

public function setMargin(m:Insets):Void

Sets the margin between the tool bar's border and its buttons. Setting to null causes the tool bar to use the default margins. The tool bar's default Border object uses this value to create the proper margin. However, if a non-default border is set on the tool bar, it is that Border object's responsibility to create the appropriate margin space (otherwise this property will effectively be ignored).

Parameters

man Insets object that defines the space between the border and the buttons

See Also

getMargin

public function getMargin():Insets

Returns the margin between the tool bar's border and its buttons.

Return

an Insets object containing the margin values

See Also

isFloatable

public function isFloatable():Boolean

Gets the floatable property.

Return

the value of the floatable property

See Also

setFloatable

public function setFloatable(b:Boolean):Void

Sets the floatable property, which must be true for the user to move the tool bar. Typically, a floatable tool bar can be dragged into a different position within the same container or out into its own window. The default value of this property is true. Some look and feels might not implement floatable tool bars; they will ignore this property.

Parameters

bif true, the tool bar can be moved; false otherwise

See Also

getOrientation

public function getOrientation():Number

Returns the current orientation of the tool bar. The value is either HORIZONTAL or VERTICAL.

Return

an integer representing the current orientation -- either HORIZONTAL or VERTICAL

See Also

setOrientation

public function setOrientation(o:Number):Void

Sets the orientation of the tool bar. The orientation must have either the value HORIZONTAL or VERTICAL. If orientation is an invalid value, default it to HORIZONTAL.

Parameters

othe new orientation -- either HORIZONTAL or VERTICAL

See Also