DefaultCheckbox.java 文件源码

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

项目:cn1 作者:
private static void drawPressedRect(Graphics g, Rectangle rect,
                                    boolean pressed) {
    int w = rect.width;
    int h = rect.height;
    int x = rect.x;
    int y = rect.y;
    g.setColor(SystemColor.controlHighlight);

    g.drawLine(x + w - 1, y, x + w - 1, y + h - 1);
    g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);
    g.setColor(SystemColor.controlShadow);
    g.drawLine(x + 1, y + 1, x + w - 3, y + 1);
    g.drawLine(x + 1, y + 1, x + 1, y + h - 3);
    g.setColor(SystemColor.controlDkShadow);
    g.drawLine(x, y, x + w - 2, y);
    g.drawLine(x, y, x, y + h - 2);
    g.setColor(pressed ? pressedColor : SystemColor.window);
    g.fillRect(x+2, y+2, CB_SIZE - 2, CB_SIZE - 2);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号