I know how to create a translucent window but I included that just for the sake of completeness.
Now here is what I am trying to do....
Create an undecorated JFrame with 60% opacity
Soft window edge.
Referring to the image above, you can see that the edges are sharp and well-defined. I want to make them soft
Give it a rounded-rectangle shape.
I can give a shape using AWTUtilities.setWindowShape(Window,Shape)
but I was wondering how I can create a rounded rectangle.
Create a reflection of the `BufferedImage` to be used as background
Why don't you use Photoshop? you may ask but it is tedious to create a reflection of every image that u wanna try to use as a background. Instead I was wondering if there is a programmatic way to:
BufferedImage
JFrame
to be twice of the original buffered image Help!!!
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import javax.swing.*;
public class ImageReflection extends JFrame{
public ImageReflection(){
ImageIcon baseIcon = new ImageIcon("src/images/mentalist-logo.png");
ImageIcon reflectIcon = new ImageIcon("src/images/mentalist-logo.png");
JLabel baseLabel = new JLabel(baseIcon);
JLabel reflectLabel = new JLabel();
Graphics2D g2D = (Graphics2D) reflectIcon.getImage().getGraphics();
g2D.rotate(180);
reflectLabel.setIcon(reflectIcon);
this.add(reflectLabel);
this.setVisible(true);
this.pack();
}
public static void main(String[] args) {
new ImageReflection();
}
}
I get an UnsupportedOperationException
at Graphics2D g2D = (Graphics2D) reflectIcon.getImage().getGraphics();
.
This is my code to turn the image upside down.