Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JToolBar
Nested Class Summary | |
protected class |
|
static class |
|
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 , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JComponent | |
TOOL_TIP_TEXT_KEY , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW , accessibleContext , listenerList , ui |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Constructor Summary | |
| |
| |
Method Summary | |
JButton | |
protected void | |
void |
|
void |
|
protected PropertyChangeListener |
|
protected JButton |
|
AccessibleContext |
|
Component |
|
int |
|
Insets |
|
int |
|
ToolBarUI |
|
String |
|
boolean |
|
boolean |
|
boolean |
|
protected void |
|
protected String |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void | |
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public JToolBar()
This method creates a new JToolBar object with horizontal orientation and no name.
public JToolBar(int orientation)
This method creates a new JToolBar with the given orientation and no name.
- Parameters:
orientation
- JToolBar orientation (HORIZONTAL or VERTICAL)
public JToolBar(String name)
This method creates a new JToolBar object with the given name and horizontal orientation.
- Parameters:
name
- Name assigned to undocked tool bar.
public JButton add(Action action)
This method adds a new JButton that performs the given Action to the JToolBar.
- Parameters:
action
- The Action to add to the JToolBar.
- Returns:
- The JButton that wraps the Action.
protected void addImpl(Component component, Object constraints, int index)
This method overrides Container's addImpl method. If a JButton is added, it is disabled.
- Parameters:
component
- The Component to add.constraints
- The Constraints placed on the component.index
- The index to place the Component at.
public void addSeparator()
This method adds a Separator of default size to the JToolBar.
public void addSeparator(Dimension size)
This method adds a Separator with the given size to the JToolBar.
- Parameters:
size
- The size of the Separator.
protected PropertyChangeListener createActionChangeListener(JButton button)
This method creates a pre-configured PropertyChangeListener which updates the control as changes are made to the Action. However, this is no longer the recommended way of adding Actions to Containers. As such, this method returns null.
- Parameters:
button
- The JButton to configure a PropertyChangeListener for.
- Returns:
- null.
protected JButton createActionComponent(Action action)
This method is used to create JButtons which can be added to the JToolBar for the given action.
- Parameters:
action
- The action to create a JButton for.
- Returns:
- The JButton created from the action.
public AccessibleContext getAccessibleContext()
Returns the object that provides accessibility features for thisJToolBar
component.
- Specified by:
- getAccessibleContext in interface Accessible
- Overrides:
- getAccessibleContext in interface JComponent
- Returns:
- The accessible context (an instance of
JToolBar.AccessibleJToolBar
).
public Component getComponentAtIndex(int index)
This method returns the component at the given index.
- Parameters:
index
- The index of the component.
- Returns:
- The component at the given index.
public int getComponentIndex(Component component)
This method returns the index of the given component.
- Parameters:
component
- The component to find.
- Returns:
- The index of the given component.
public Insets getMargin()
This method returns the margin property.
- Returns:
- The margin property.
public int getOrientation()
This method returns the orientation of the JToolBar.
- Returns:
- The orientation of the JToolBar.
public ToolBarUI getUI()
This method returns the UI class used to paint this JToolBar.
- Returns:
- The UI class for this JToolBar.
public String getUIClassID()
This method returns the String identifier for the UI class to the used with the JToolBar.
- Overrides:
- getUIClassID in interface JComponent
- Returns:
- The String identifier for the UI class.
public boolean isBorderPainted()
This method returns the borderPainted property.
- Returns:
- The borderPainted property.
public boolean isFloatable()
This method returns the floatable property.
- Returns:
- The floatable property.
public boolean isRollover()
This method returns the rollover property.
- Returns:
- The rollover property.
protected void paintBorder(Graphics graphics)
This method paints the border if the borderPainted property is true.
- Overrides:
- paintBorder in interface JComponent
- Parameters:
graphics
- The graphics object to paint with.
protected String paramString()
Returns a string describing the attributes for theJToolBar
component, for use in debugging. The return value is guaranteed to be non-null
, but the format of the string may vary between implementations.
- Overrides:
- paramString in interface JComponent
- Returns:
- A string describing the attributes of the
JToolBar
.
public void setBorderPainted(boolean painted)
This method sets the borderPainted property. If set to false, the border will not be painted.
- Parameters:
painted
- Whether the border will be painted.
public void setFloatable(boolean floatable)
This method sets the floatable property. If set to false, the JToolBar cannot be dragged.
- Parameters:
floatable
- Whether the JToolBar can be dragged.
public void setLayout(LayoutManager mgr)
This method sets the layout manager to be used with the JToolBar.
- Parameters:
mgr
- The Layout Manager used with the JToolBar.
public void setMargin(Insets margin)
This method sets the margin property. The margin property determines the extra space between the children components of the JToolBar and the border.
- Parameters:
margin
- The margin property.
public void setOrientation(int orientation)
This method sets the orientation property for JToolBar.
- Parameters:
orientation
- The new orientation for JToolBar.
- Throws:
IllegalArgumentException
- If the orientation is not HORIZONTAL or VERTICAL.
public void setRollover(boolean b)
This method sets the rollover property for the JToolBar. In rollover mode, JButtons inside the JToolBar will only display their borders when the mouse is moving over them.
- Parameters:
b
- The new rollover property.
public void setUI(ToolBarUI ui)
This method sets the UI used with the JToolBar.
- Parameters:
ui
- The UI used with the JToolBar.
public void updateUI()
This method resets the UI used to the Look and Feel defaults.
- Overrides:
- updateUI in interface JComponent