1
0

Add method for creating JLayer with component

This commit is contained in:
Victor 2014-03-24 21:29:20 +02:00
parent 7cfaf2cd06
commit b9c20a9bc0

View File

@ -10,12 +10,18 @@ import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JLayer;
import javax.swing.plaf.LayerUI;
/** /**
* *
* @author aNNiMON * @author aNNiMON
*/ */
public class GuiUtil { public class GuiUtil {
public static <T extends JComponent> JLayer<T> createPlanetLayer(T component) {
return new JLayer<>(component, (LayerUI<T>) new PlanetBackground());
}
public static class GradientBackground extends javax.swing.plaf.LayerUI<JComponent> { public static class GradientBackground extends javax.swing.plaf.LayerUI<JComponent> {