protected static class

BorderedComponent.LabeledBorder

extends TitledBorder
java.lang.Object
   ↳ javax.swing.border.AbstractBorder
     ↳ javax.swing.border.TitledBorder
       ↳ sun.tools.jconsole.BorderedComponent.LabeledBorder

Class Overview

A subclass of TitledBorder which implements an arbitrary border with the addition of a JComponent (JLabel, JPanel, etc) in the default position.

If the border property value is not specified in the constuctor or by invoking the appropriate set method, the property value will be defined by the current look and feel, using the following property name in the Defaults Table:

  • "TitledBorder.border"

Summary

[Expand]
Inherited Constants
From class javax.swing.border.TitledBorder
Fields
protected JComponent label
[Expand]
Inherited Fields
From class javax.swing.border.TitledBorder
Public Constructors
BorderedComponent.LabeledBorder(JComponent label)
Creates a LabeledBorder instance.
BorderedComponent.LabeledBorder(Border border)
Creates a LabeledBorder instance with the specified border and an empty label.
BorderedComponent.LabeledBorder(Border border, JComponent label)
Creates a LabeledBorder instance with the specified border and label.
Public Methods
Insets getBorderInsets(Component c, Insets insets)
Reinitialize the insets parameter with this Border's current Insets.
JComponent getLabel()
Returns the label of the labeled border.
Dimension getMinimumSize(Component c)
Returns the minimum dimensions this border requires in order to fully display the border and title.
void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
Paints the border for the specified component with the specified position and size.
void setLabel(JComponent label)
Sets the title of the titled border.
[Expand]
Inherited Methods
From class javax.swing.border.TitledBorder
From class javax.swing.border.AbstractBorder
From class java.lang.Object
From interface javax.swing.border.Border

Fields

protected JComponent label

Public Constructors

public BorderedComponent.LabeledBorder (JComponent label)

Creates a LabeledBorder instance.

Parameters
label the label the border should display

public BorderedComponent.LabeledBorder (Border border)

Creates a LabeledBorder instance with the specified border and an empty label.

Parameters
border the border

public BorderedComponent.LabeledBorder (Border border, JComponent label)

Creates a LabeledBorder instance with the specified border and label.

Parameters
border the border
label the label the border should display

Public Methods

public Insets getBorderInsets (Component c, Insets insets)

Reinitialize the insets parameter with this Border's current Insets.

Parameters
c the component for which this border insets value applies
insets the object to be reinitialized
Returns
  • the insets object

public JComponent getLabel ()

Returns the label of the labeled border.

public Dimension getMinimumSize (Component c)

Returns the minimum dimensions this border requires in order to fully display the border and title.

Parameters
c the component where this border will be drawn

public void paintBorder (Component c, Graphics g, int x, int y, int width, int height)

Paints the border for the specified component with the specified position and size.

Parameters
c the component for which this border is being painted
g the paint graphics
x the x position of the painted border
y the y position of the painted border
width the width of the painted border
height the height of the painted border

public void setLabel (JComponent label)

Sets the title of the titled border. param title the title for the border