想做一个漂亮的border
大家一定看过各种各样的边界.那么在JAVA中自定义BORDER,是怎样实现呢?
其实可能都知道,那就是继承Border接口,或是AbstractBorder类,并重写:
Insets getBorderInsets(Component c);
void paintBorder(Component c,Graphics g,int x,int y,int width,int height);
boolean isBorderOpaque();
三个方法,但是比如:我在 paintBorder方法中画出一个椭圆后,在椭圆的四个角那里不是有空缺吗?
这四个空缺还是能显示出来,怎么才能只看使他们不显示出来呢?