@Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g.create(); if (getActiveSide() == ALL) { drawSelection(g2d); } else { drawCrossHair(g2d); } } };
@Override protected void paintComponent(Graphics g) { Graphics2D gr = (Graphics2D) g; gr.setPaint(backgroundPaint); gr.fillRect(0, 0, getWidth(), getHeight()); super.paintComponent(g); }
@Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; // //////////////////////////////////////////////////////////////// // antialiasing g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // //////////////////////////////////////////////////////////////// /** * draw text */ if (!invertColors) { g2D.setFont(f); g2D.setColor(new Color(0, 0, 0)); g2D.drawString(this.text, 1, 14); g2D.setColor(new Color(255, 255, 255, 230)); g2D.drawString(this.text, 0, 13); } else { g2D.setFont(f); g2D.setColor(new Color(255, 255, 255, 230)); g2D.drawString(this.text, 1, 14); g2D.setColor(new Color(0, 0, 0)); g2D.drawString(this.text, 0, 13); } g2D.dispose(); }
@Override protected void paintComponent(Graphics g) { super.paintComponent(g); // #9804. Draw bullet if the content is not numbered. if (!WrappedCellRenderer.this.contentNumbered) { java.awt.Rectangle rect = g.getClipBounds(); g.fillOval(rect.x, rect.y, 7, 7); } } };
@Override public void paintComponent(final Graphics g) { g.setColor(getBackground()); int offset = 0; if (getIcon() != null) { offset = getIcon().getIconWidth() + getIconTextGap(); } g.fillRect(offset, 0, getWidth() - 1 - offset, getHeight() - 1); if (selected) { g.setColor(UIManager.getColor("Tree.selectionBorderColor")); g.drawRect(offset, 0, getWidth() - 1 - offset, getHeight() - 1); } super.paintComponent(g); }
@Override protected void paintComponent(Graphics graphics) { Graphics2D g = (Graphics2D) graphics; int iconHeight = getIcon() == null ? 0 : getIcon().getIconHeight() + getIconTextGap(); // Paint checkered bg behind icon g.setPaint(checkeredBG); g.fillRect(0, 0, getWidth(), getHeight()); // Paint black bg behind text g.setColor(getBackground()); g.fillRect(0, iconHeight, getWidth(), getHeight() - iconHeight); try { opaque = false; super.paintComponent(g); } finally { opaque = true; } }
@Override protected final void paintComponent(Graphics g) { super.paintComponent(g); } }
@Override protected void paintComponent(Graphics g) { if (myEditorPane == null) { super.paintComponent(g); } }
public void paintComponent(Graphics g) { if (g instanceof Graphics2D) { ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } super.paintComponent(g); } }
@Override protected void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; Composite alphaComp = AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 1.0f); g2d.setComposite(alphaComp); super.paintComponent(g2d); } }
@Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (this.hintIcon != null) { int iconWidth = hintIcon.getIconWidth(); int x = getWidth() - iconWidth - 2; int y = 0; hintIcon.paintIcon(this, g, x, y); } } }
@Override protected void paintComponent(Graphics g) { // Fixes font antialias problem on Windows // Note: Must be this exact reference or it doesn't work // e.g. using new StringBuffer("AATextInfoPropertyKey") fails // See StackOverflow: http://stackoverflow.com/questions/2266199/how-to-make-jtextpane-paint-anti-aliased-font if (useAATextProperty) { this.putClientProperty(SwingUtilities2.AA_TEXT_PROPERTY_KEY, null); } super.paintComponent(g); } }
@Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g.create(); g2.setComposite(AlphaComposite.SrcOver.derive(this.alpha)); super.paintComponent(g2); g2.dispose(); } }
@Override public void paintComponent(Graphics g) { g.setColor(SystemColor.activeCaption); int width = getWidth() * battlefieldWidthSlider.getValue() / MAX_BATTLEFIELD_SIZE; int height = getHeight() * battlefieldHeightSlider.getValue() / MAX_BATTLEFIELD_SIZE; g.fillRect(0, 0, width, height); super.paintComponent(g); } }
public void paintComponent(Graphics g) { if (isRenderImage()) { super.paintComponent(g); } else { viewer.paintPage((Graphics2D)g.create()); } }
public @Override void paintComponent(Graphics g) { super.paintComponent(g); if (item.kind == Kind.MAIN) { g.setColor(Color.gray); int h = getHeight(); h -= 2; g.drawLine(0, h, getWidth(), h); } } }
@Override protected void paintComponent( final Graphics g ) { final Graphics2D g2d = (Graphics2D)g; final RenderingHints oldHints = g2d.getRenderingHints(); g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); super.paintComponent( g ); g2d.setRenderingHints( oldHints ); }
@Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g.create(); // Insets ins = getInsets(); g2.setPaint(new GradientPaint(50, 0, Color.WHITE, getWidth(), getHeight(), bgc)); g2.fillRect(0, 0, getWidth(), getHeight()); g2.dispose(); super.paintComponent(g); } };
@Override public void paintComponent(Graphics g) { super.paintComponent(g); if (getIcon()!=null) g.drawImage(((ImageIcon)getIcon()).getImage(), 0, 0, getWidth(), getHeight(), null); }
public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; Paint p = g2.getPaint(); g2.setPaint(new GradientPaint(0, 0, Color.WHITE, getWidth(), 0, getBackground())); g2.fillRect(0, 0, getWidth(), getHeight()); g2.setPaint(p); super.paintComponent(g); } };