Override the paintComponents method in your component and there you get a Graphics2D object:
public void paintComponent(Graphics g){
Graphics2D g2d = (Graphics2D)g;
// do your paint here
}
Do not call this method to repaint your component, do so by calling "repaint()"):
yourComponent.repaint()