Java Transparency OPAQUE
Syntax
Transparency.OPAQUE has the following syntax.
static final int OPAQUE
Example
In the following code shows how to use Transparency.OPAQUE field.
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
/*from www . j a v a 2 s . co m*/
public class Main {
public static void main(String[] argv) throws Exception {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gs = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = gs.getDefaultConfiguration();
// Create an image that does not support transparency
BufferedImage bimage = gc.createCompatibleImage(100, 100, Transparency.OPAQUE);
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »