Package UI
Class SolidBorder
- java.lang.Object
-
- UI.SolidBorder
-
- All Implemented Interfaces:
javax.swing.border.Border
public class SolidBorder extends java.lang.Object implements javax.swing.border.BorderSolidBorder is a class that implements the Border interface. It provides a solid border with customizable top and bottom colors.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.ColorbottomColorprotected java.awt.ColortopColor
-
Constructor Summary
Constructors Constructor Description SolidBorder()Constructs a SolidBorder with default colors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.InsetsgetBorderInsets(java.awt.Component c)Returns the insets of the border.booleanisBorderOpaque()Indicates whether the border is opaque.voidpaintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)Paints the border for the specified component.
-
-
-
Method Detail
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c)
Returns the insets of the border. The insets are set to 2 pixels on all sides.- Specified by:
getBorderInsetsin interfacejavax.swing.border.Border- Parameters:
c- the component for which this border insets value applies- Returns:
- the insets of the border
-
isBorderOpaque
public boolean isBorderOpaque()
Indicates whether the border is opaque.- Specified by:
isBorderOpaquein interfacejavax.swing.border.Border- Returns:
- true if the border is opaque, false otherwise
-
paintBorder
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)Paints the border for the specified component. Draws the border with the top color on the top and left sides, and the bottom color on the bottom and right sides.- Specified by:
paintBorderin interfacejavax.swing.border.Border- Parameters:
c- the component for which this border is being paintedg- the Graphics context in which to paintx- the x position of the painted bordery- the y position of the painted borderwidth- the width of the painted borderheight- the height of the painted border
-
-