List of usage examples for java.awt GradientPaint getTransparency
public int getTransparency()
From source file:Main.java
public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g; GradientPaint gp1 = new GradientPaint(5, 5, Color.red, 20, 20, Color.yellow, true); System.out.println(gp1.getTransparency()); g2d.setPaint(gp1);//from www . j a va 2 s. c o m g2d.fillRect(20, 20, 300, 40); }
From source file:Main.java
public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g; GradientPaint gp1 = new GradientPaint(5, 5, Color.red, 20, 20, Color.yellow, true); gp1.createContext(ColorModel.getRGBdefault(), new Rectangle(0, 0, 30, 40), new Rectangle(0, 0, 30, 40), new AffineTransform(), null); System.out.println(gp1.getTransparency()); g2d.setPaint(gp1);//from w w w . j a v a2s . c o m g2d.fillRect(20, 20, 300, 40); }