Example usage for javax.swing SwingUtilities paintComponent

List of usage examples for javax.swing SwingUtilities paintComponent

Introduction

In this page you can find the example usage for javax.swing SwingUtilities paintComponent.

Prototype

public static void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h) 

Source Link

Document

Paints a component to the specified Graphics.

Usage

From source file:Main.java

@Override
public void paint(Graphics g, JComponent c) {
    super.paint(g, c);
    Dimension d = l.getPreferredSize();
    int x = c.getWidth() - d.width - 5;
    SwingUtilities.paintComponent(g, l, rubberStamp, x, 2, d.width, d.height);
}