All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.JToolBar

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.Container
                    |
                    +----java.awt.swing.JComponent
                            |
                            +----java.awt.swing.JToolBar

public class JToolBar
extends JComponent
implements Accessible
An implementation of a ToolBar


Class Index

 o JToolBar.Separator

Constructor Index

 o JToolBar()

Method Index

 o add(Action)
 o addSeparator()
Adds a separator to the ToolBar.
 o getAccessibleRole()
Get the role of this object.
 o getAccessibleStateSet()
Get the state of this object.
 o getComponentAtIndex(int)
 o getComponentIndex(Component)
 o getMargin()
Returns the margin between the toolbar's border and its buttons.
 o getUI()
Returns the toolbar's current UI.
 o getUIClassID()
 o isBorderPainted()
Checks whether the border should be painted.
 o isOpaque()
 o paintBorder(Graphics)
Paint the toolbar's border if BorderPainted property is true.
 o setBorderPainted(boolean)
Sets whether the border should be painted.
 o setMargin(Insets)
Sets the margin between the toolbar's border and its buttons.
 o setOpaque(boolean)
If true the buttons background will be filled with the background color.
 o setUI(ToolBarUI)
Sets the toolbar's UI.
 o updateUI()
Gets a new UI object from the default UIFactory.

Constructors

 o JToolBar
public JToolBar()

Methods

 o getUI
public ToolBarUI getUI()
Returns the toolbar's current UI.

See Also:
setUI
 o setUI
public void setUI(ToolBarUI ui)
Sets the toolbar's UI.

Parameters:
ui - the new ToolBarUI
See Also:
getUI
 o updateUI
public void updateUI()
Gets a new UI object from the default UIFactory.

Overrides:
updateUI in class JComponent
 o getUIClassID
public String getUIClassID()
Returns:
"ToolBarUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI
 o getComponentIndex
public int getComponentIndex(Component c)
 o getComponentAtIndex
public Component getComponentAtIndex(int i)
 o setMargin
public void setMargin(Insets m)
Sets the margin between the toolbar's border and its buttons. Setting to null will cause the toolbar to use the default margins. The toolbar's default Border object will use this value to create the proper margin. However, if a non-default border is set on the toolbar, it is that Border object's responsibility to create the appropriate margin space (else this property will effectively be ignored).

Parameters:
m - the space between the border and the buttons
 o getMargin
public Insets getMargin()
Returns the margin between the toolbar's border and its buttons.

 o isBorderPainted
public boolean isBorderPainted()
Checks whether the border should be painted.

See Also:
setBorderPainted
 o setOpaque
public void setOpaque(boolean isOpaque)
If true the buttons background will be filled with the background color.

The default value of this property is true.

This is a JavaBeans bound property.

See Also:
isOpaque, getBackground
 o isOpaque
public boolean isOpaque()
Returns:
The value of the opaque property.
Overrides:
isOpaque in class JComponent
See Also:
setOpaque
 o setBorderPainted
public void setBorderPainted(boolean b)
Sets whether the border should be painted.

Parameters:
b - if true, the border is painted.
See Also:
isBorderPainted
 o paintBorder
protected void paintBorder(Graphics g)
Paint the toolbar's border if BorderPainted property is true.

Overrides:
paintBorder in class JComponent
See Also:
paint, setBorder
 o addSeparator
public void addSeparator()
Adds a separator to the ToolBar.

 o add
public JButton add(Action a)
 o getAccessibleStateSet
public AccessibleStateSet getAccessibleStateSet()
Get the state of this object.

Returns:
an instance of AccessibleStateSet containing the current state set of the object
Overrides:
getAccessibleStateSet in class JComponent
See Also:
AccessibleState
 o getAccessibleRole
public AccessibleRole getAccessibleRole()
Get the role of this object.

Returns:
an instance of AccessibleRole describing the role of the object
Overrides:
getAccessibleRole in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature