|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
![]()
![]()
![]()
javax.swing.JComponent
![]()
![]()
![]()
javax.swing.JToolBar
, MenuContainer
, Serializable
, Accessible
, SwingConstants

public class JToolBar

, Accessible

JToolBar provides a component that is useful for
displaying commonly used Actions or controls.
For examples and information on using tool bars see
How to Use Tool Bars,
a section in The Java Tutorial.
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".
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder
.
Action
,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
JToolBar.AccessibleJToolBar
This class implements accessibility support for the JToolBar class. |
static class |
JToolBar.Separator
A toolbar-specific separator. |
Nested classes/interfaces inherited from class javax.swing.JComponent ![]() |
|---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container ![]() |
|---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary |
|---|
Fields inherited from class javax.swing.JComponent ![]() |
|---|
accessibleContext |
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants ![]() |
|---|
BOTTOM |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
JToolBar
Creates a new tool bar; orientation defaults to HORIZONTAL. |
|
JToolBar
Creates a new tool bar with the specified orientation. |
|
JToolBar
Creates a new tool bar with the specified name. |
|
JToolBar
Creates a new tool bar with a specified name and
orientation. |
|
| Method Summary | |
|---|---|
JButton |
add
Adds a new JButton which dispatches the action. |
protected void |
addImpl
If a JButton is being added, it is initially
set to be disabled. |
void |
addSeparator
Appends a separator of default size to the end of the tool bar. |
void |
addSeparator
Appends a separator of a specified size to the end of the tool bar. |
protected PropertyChangeListener |
createActionChangeListener
Returns a properly configured PropertyChangeListener
which updates the control as changes to the Action occur,
or null if the default
property change listener for the control is desired. |
protected JButton |
createActionComponent
Factory method which creates the JButton for
Actions added to the JToolBar. |
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this JToolBar. |
Component |
getComponentAtIndex
Returns the component at the specified index. |
int |
getComponentIndex
Returns the index of the specified component. |
Insets |
getMargin
Returns the margin between the tool bar's border and its buttons. |
int |
getOrientation
Returns the current orientation of the tool bar. |
ToolBarUI |
getUI
Returns the tool bar's current UI. |
String |
getUIClassID
Returns the name of the L&F class that renders this component. |
boolean |
isBorderPainted
Gets the borderPainted property. |
boolean |
isFloatable
Gets the floatable property. |
boolean |
isRollover
Returns the rollover state. |
protected void |
paintBorder
Paints the tool bar's border if the borderPainted property
is true. |
protected String |
paramString
Returns a string representation of this JToolBar. |
void |
setBorderPainted
Sets the borderPainted property, which is
true if the border should be painted. |
void |
setFloatable
Sets the floatable property,
which must be true for the user to move the tool bar. |
void |
setLayout
Sets the layout manager for this container. |
void |
setMargin
Sets the margin between the tool bar's border and its buttons. |
void |
setOrientation
Sets the orientation of the tool bar. |
void |
setRollover
Sets the rollover state of this toolbar. |
void |
setUI
Sets the L&F object that renders this component. |
void |
updateUI
Notification from the UIFactory that the L&F has changed. |
Methods inherited from class javax.swing.JComponent ![]() |
|---|
addAncestorListener |