All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----gjt.Border
Thickness of the border, and the gap between the Component and the border are specified at time of construction. Default border thickness is 2 - default gap is 0.
Border color may be set via setLineColor(Color).
Border employs a DrawnRectangle to paint the border. Derived classes are free to override DrawnRectangle border() if they wish to use an extension of DrawnRectangle for drawing their border.
The following code snippet, from gjt.test.BorderTest creates an AWT Button, and embeds the button in a border. That border is then embedded in another border. The AWT Button winds up inside of a cyan border with a pixel width of 7, inside of a black border (pixel width 2):
private Border makeBorderedAWTButton() {
Button button;
Border cyanBorder, blackBorder;
button = new Button("Button Inside Two Borders");
cyanBorder = new Border(button, 7);
cyanBorder.setLineColor(Color.cyan);
blackBorder = new Border(cyanBorder);
return blackBorder;
}
protected int thickness
protected int gap
protected DrawnRectangle border
protected Component borderMe
protected static int _defaultThickness
protected static int _defaultGap
public Border(Component borderMe)
public Border(Component borderMe,
int thickness)
public Border(Component borderMe,
int thickness,
int gap)
public Component getComponent()
public Rectangle getInnerBounds()
public void setLineColor(Color c)
public Color getLineColor()
public void paint(Graphics g)
public Insets insets()
public Insets getInsets()
public void resize(int w,
int h)
public void setSize(int w,
int h)
public void reshape(int x,
int y,
int w,
int h)
public void setBounds(int x,
int y,
int w,
int h)
protected String paramString()
protected DrawnRectangle border()
All Packages Class Hierarchy This Package Previous Next Index