javax.swing.plaf.basic

Class BasicToggleButtonUI

public class BasicToggleButtonUI extends BasicButtonUI

A UI delegate for the 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 UIManager defaults table ("ToggleButton."
voidpaint(Graphics g, JComponent c)
Paint the component, which is an 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 JToggleButton).

Returns: An instance of BasicToggleButtonUI.

getPropertyPrefix

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

Returns: "ToggleButton."

paint

public void paint(Graphics g, JComponent c)
Paint the component, which is an 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 BasicButtonUI.

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