package de.mazdermind.MultiWiiOps.UI;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;

public class RoundTestPanel extends TestPanel {
	private static final long serialVersionUID = 4813133879294967482L;

	public RoundTestPanel() {
		super();
	}

	public RoundTestPanel(Color bg) {
		super(bg);
	}

	public RoundTestPanel(String label, Color bg) {
		super(label, bg);
	}

	public RoundTestPanel(String label) {
		super(label);
	}

	public void paintComponent(Graphics g) {
		Rectangle2D stringBounds = g.getFontMetrics().getStringBounds(getText(), g);
		int
			w = getWidth() - 1,
			h = getHeight() - 1,
			sz = Math.min(w,  h),
			x = (w - sz) / 2,
			y = (h - sz) / 2,
			tx = (int) ((w - stringBounds.getWidth()) / 2),
			ty = (int) ((h + stringBounds.getHeight()) / 2);

		Color bg = getBackground();
		g.setColor(bg);
		g.fillArc(x, y, sz, sz, 0, 360);
		
		g.setColor(getForeground());
		g.drawString(getText(), tx, ty);
   }
}

@@ -271,19 +271,39 @@
 uper();%0A
+%09%09setOpaque(false);%0A
 %09%7D%0A
-
 %0A%09public
@@ -339,24 +339,44 @@
 %09super(bg);%0A
+%09%09setOpaque(false);%0A
 %09%7D%0A%0A%09public 
@@ -436,16 +436,36 @@
 l, bg);%0A
+%09%09setOpaque(false);%0A
 %09%7D%0A%0A%09pub
@@ -495,24 +495,24 @@
 ng label) %7B%0A
-
 %09%09super(labe
@@ -515,16 +515,36 @@
 label);%0A
+%09%09setOpaque(false);%0A
 %09%7D%0A%0A%09pub

fix opaqness-information for rounded panel (thus fixing rendering-issues on windows), see http://www.chka.de/swing/components/opacity.html