Class ShadowBorder

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.border.Border

    public class ShadowBorder
    extends javax.swing.border.AbstractBorder
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowBorder()
      Creates a border with a grey 1 pixel line on left and top and a 3 pixel (scaled to Hi-dpi factor) wide shadow on right and bottom.
      ShadowBorder​(int top, int left, int bottom, int right)
      Creates a border with a grey 1 pixel line on left and top and a 3 pixel wide shadow on right and bottom.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Insets getBorderInsets​(java.awt.Component c)  
      void paintBorder​(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)  
      void setColor​(java.awt.Color c)  
      static int shadowSize()  
      static int thinSize()  
      • Methods inherited from class javax.swing.border.AbstractBorder

        getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowBorder

        public ShadowBorder()
        Creates a border with a grey 1 pixel line on left and top and a 3 pixel (scaled to Hi-dpi factor) wide shadow on right and bottom. Insets are as large as needed for the drawn border.
      • ShadowBorder

        public ShadowBorder​(int top,
                            int left,
                            int bottom,
                            int right)
        Creates a border with a grey 1 pixel line on left and top and a 3 pixel wide shadow on right and bottom. Insets can be specified to be larger than the drawn border, which allows to adjust the spacing outside the drawn border.
    • Method Detail

      • thinSize

        public static int thinSize()
      • shadowSize

        public static int shadowSize()
      • setColor

        public void setColor​(java.awt.Color c)
      • getBorderInsets

        public java.awt.Insets getBorderInsets​(java.awt.Component c)
        Specified by:
        getBorderInsets in interface javax.swing.border.Border
        Overrides:
        getBorderInsets in class javax.swing.border.AbstractBorder
      • paintBorder

        public void paintBorder​(java.awt.Component c,
                                java.awt.Graphics g,
                                int x,
                                int y,
                                int w,
                                int h)
        Specified by:
        paintBorder in interface javax.swing.border.Border
        Overrides:
        paintBorder in class javax.swing.border.AbstractBorder