Package UI
Class OvalBorder
- java.lang.Object
-
- UI.OvalBorder
-
- All Implemented Interfaces:
javax.swing.border.Border
public class OvalBorder extends java.lang.Object implements javax.swing.border.BorderOvalBorder is a class that implements the Border interface. It creates an oval-shaped border with specified width, height, and colors.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.ColordarkColorprotected java.awt.ColorlightColorprotected intovalHeightprotected intovalWidth
-
Constructor Summary
Constructors Constructor Description OvalBorder()
-
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 determined based on the oval width and height.- 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 oval-shaped border with the specified light and dark colors.- 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
-
-