@Override public void paint(Graphics g, JComponent c) { super.paint(g, c); final Color COLOR = new Color(red, green, blue, alpha); g.setColor(COLOR); g.fillRect(0, 0, c.getWidth(), c.getHeight()); }
@Override public void paint(Graphics g, JComponent comp) { Graphics2D g2 = (Graphics2D) g; super.paint(g2, comp); if (this.blur) { g2.setComposite(alpha(0.5F)); g2.fillRect(0, 0, comp.getWidth(), comp.getHeight()); } }
@Override public void paint(Graphics g, JComponent c) { super.paint(g, c); if (isSelected()) { final int N = 6; final int A = 220; final Color C = new Color(255, 213, 79); for (int i = 0; i < N; i++) { g.setColor(new Color(C.getRed(), C.getGreen(), C.getBlue(), A - i * A / N)); g.drawRect(i, i, getWidth() - 2 * i, getHeight() - 2 * i); } } } }
/** * Paints the component with the current zoom scale * @param g graphics * @param c component */ @Override public void paint(Graphics g, JComponent c) { g.clearRect(c.getX(), c.getY(), c.getWidth(), c.getHeight()); Graphics2D g2 = (Graphics2D) g; g2.scale(zoom, zoom); super.paint(g2, c); }
@Override public void paint(Graphics g, JComponent c) { super.paint(g, c); JLayer<JTextField> jLayer = (JLayer<JTextField>) c; JTextField textField = jLayer.getView(); ValidationResult result = validator.check(textField); if (!result.isOK()) { Graphics2D g2 = (Graphics2D) g.create(); // Paint the red X. g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON); int w = c.getWidth(); int h = c.getHeight(); int s = 8; int pad = 10; int x = w - pad - s; int y = (h - s) / 2; g2.setPaint(RED); g2.fillRect(x, y, s + 1, s + 1); g2.setPaint(WHITE); g2.drawLine(x, y, x + s, y + s); g2.drawLine(x, y + s, x + s, y); g2.dispose(); } } }
@Override public void paint (Graphics g, JComponent c) { super.paint (g, c); if (!running) { return;
@Override public void paint (Graphics g, JComponent c) { super.paint (g, c); if (!running) { return;