javax.swing.plaf.basic

Class BasicToggleButtonUI

public class BasicToggleButtonUI extends BasicButtonUI

A UI delegate for the {@link JToggleButton} component.
Method Summary
static ComponentUIcreateUI(JComponent component)
Returns a UI delegate for the specified component.
protected StringgetPropertyPrefix()
Returns the prefix for entries in the {@link UIManager} defaults table ("ToggleButton." in this case).
voidpaint(Graphics g, JComponent c)
Paint the component, which is an {@link AbstractButton}, according to its current state.
protected voidpaintIcon(Graphics g, AbstractButton b, Rectangle iconRect)
Paints the icon for the toggle button.

Method Detail

createUI

public static ComponentUI createUI(JComponent component)
Returns a UI delegate for the specified component.

Parameters: component the component (should be an instance of {@link JToggleButton}).

Returns: An instance of BasicToggleButtonUI.

getPropertyPrefix

protected String getPropertyPrefix()
Returns the prefix for entries in the {@link UIManager} defaults table ("ToggleButton." in this case).

Returns: "ToggleButton."

paint

public void paint(Graphics g, JComponent c)
Paint the component, which is an {@link AbstractButton}, according to its current state.

Parameters: g The graphics context to paint with c The component to paint the state of

paintIcon

protected void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect)
Paints the icon for the toggle button. This delegates to {@link BasicButtonUI#paintIcon(Graphics, JComponent, Rectangle)}.

Parameters: g the graphics context b the button to paint the icon for iconRect the area allocated for the icon