DefaultButton.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:cn1 作者:
public static void drawButtonFrame(Graphics g, Rectangle rect, boolean pressed) {
    if (pressed) {
        g.setColor(SystemColor.controlHighlight);
        g.drawLine(rect.width - 1, 0, rect.width - 1, rect.height - 1);
        g.drawLine(0, rect.height - 1, rect.width - 1, rect.height - 1);
        g.setColor(SystemColor.controlShadow);
        g.drawLine(1, 1, rect.width - 3, 1);
        g.drawLine(1, 1, 1, rect.height - 3);
        g.setColor(SystemColor.controlDkShadow);
        g.drawLine(0, 0, rect.width - 2, 0);
        g.drawLine(0, 0, 0, rect.height - 2);
    } else {
        g.setColor(SystemColor.controlHighlight);
        g.drawLine(0, 0, rect.width - 1, 0);
        g.drawLine(0, 0, 0, rect.height - 1);
        g.setColor(SystemColor.controlShadow);
        g.drawLine(rect.width - 2, 1, rect.width - 2, rect.height - 2);
        g.drawLine(1, rect.height - 2, rect.width - 2, rect.height - 2);
        g.setColor(SystemColor.controlDkShadow);
        g.drawLine(rect.width - 1, 0, rect.width - 1, rect.height - 1);
        g.drawLine(0, rect.height - 1, rect.width - 1, rect.height - 1);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号