APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicPanelUI

extends PanelUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.synth.SynthPanelUI
Imports
java.awt.*, java.awt.*, javax.swing.*, javax.swing.border.*, javax.swing.plaf.*, java.awt.event.*

BasicPanel implementation
Author
Steve Wilson

Field Summary

Modifier and TypeField and Description
private static PanelUI

Constructor Summary

AccessConstructor and Description
public
BasicPanelUI()

Constructs a BasicPanelUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

an instance of BasicPanelUI
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Returns an instance of BasicPanelUI.

public int
getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.ComponentUI.getBaseline.

Returns the baseline.

public Component.BaselineResizeBehavior
getBaselineResizeBehavior(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getBaselineResizeBehavior.

Returns an enum indicating how the baseline of the component changes as the size changes.

protected void
installDefaults(JPanel
an instance of JPanel
p
)

Method for installing panel properties.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.

protected void
uninstallDefaults(JPanel
an instance of JPanel
p
)

Method for uninstalling panel properties.

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.

Field Detail

panelUIback to summary
private static PanelUI panelUI

Constructor Detail

BasicPanelUIback to summary
public BasicPanelUI()

Constructs a BasicPanelUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.ComponentUI.createUI.

Returns an instance of BasicPanelUI.

Parameters
c:JComponent

a component

Returns:ComponentUI

an instance of BasicPanelUI

getBaselineback to summary
public int getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.ComponentUI.getBaseline.

Returns the baseline.

Exceptions
NullPointerException:
if c is null
IllegalArgumentException:
if width or height is < 0
Since
1.6
See Also
javax.swing.JComponent#getBaseline(int, int)
getBaselineResizeBehaviorback to summary
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getBaselineResizeBehavior.

Returns an enum indicating how the baseline of the component changes as the size changes.

Exceptions
NullPointerException:
if c is null
Since
1.6
See Also
javax.swing.JComponent#getBaseline(int, int)
installDefaultsback to summary
protected void installDefaults(JPanel p)

Method for installing panel properties.

Parameters
p:JPanel

an instance of JPanel

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Doc from javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:

  1. Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.
uninstallDefaultsback to summary
protected void uninstallDefaults(JPanel p)

Method for uninstalling panel properties.

Parameters
p:JPanel

an instance of JPanel

uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Doc from javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.