@Override protected void paintBorder(Graphics g) { if (!this.getModel().isPressed()) { super.paintBorder(g); } } };
@Override protected void paintBorder(Graphics g) { if (!this.getModel().isPressed()) { super.paintBorder(g); } } };
protected void paintBorder(Graphics g) { super.paintBorder(g); if (red) { Graphics2D g2 = (Graphics2D) g; g2.setColor(COLOR_TODAY); g2.setStroke(new BasicStroke(2)); g2.drawRoundRect(HALF_WIDTH, HALF_WIDTH, this.getWidth() - HALF_WIDTH - 1, this.getHeight() - HALF_WIDTH - 1, this.getWidth(), this.getHeight()); } }
@Override public void paintComponent(Graphics g) { super.paintComponent(g); int w = getWidth(); int h = getHeight(); Insets i = getInsets(); int fx = i.left; int fy = i.top; int fw = w - fx - i.right; int fh = h - fy - i.bottom; g.setColor(colorChoice); g.fillRect(fx, fy, fw, fh); super.paintBorder(g); } }
protected void paintBorder(Graphics g) { super.paintBorder(g); ButtonModel model = this.getModel(); if (model.isSelected()) { Graphics2D g2 = (Graphics2D) g; g2.setColor(COLOR_TODAY); g2.setStroke(new BasicStroke(2)); g2.drawRoundRect(HALF_WIDTH, HALF_WIDTH, this.getWidth() - HALF_WIDTH - 1, this.getHeight() - HALF_WIDTH - 1, this.getWidth(), this.getHeight()); } }
protected void paintBorder(Graphics g) { super.paintBorder(g); ButtonModel model = this.getModel(); if (model.isSelected()) { Graphics2D g2 = (Graphics2D) g; g2.setColor(COLOR_TODAY); g2.setStroke(new BasicStroke(2)); g2.drawRoundRect(HALF_WIDTH, HALF_WIDTH, this.getWidth() - HALF_WIDTH - 1, this.getHeight() - HALF_WIDTH - 1, this.getWidth(), this.getHeight()); } }