Alpha « JLabel « Java Swing Q&A





1. Jlabel with alpha value    stackoverflow.com

Hi: i have jLabel and i want to change its opacity (alpha value) each one second , i tried something like that but its not change each one second , jlable ...

2. JLabel opaque and alpha    stackoverflow.com

In JPanel I have few JLabels created like this:

...
Random rand = new Random();
Color col = new Color(rand.nextFloat(),
rand.nextFloat(),
rand.nextFloat(),
rand.nextFloat());
Color playColor= new Color(col.getRed(), col.getGreen(), col.getBlue(), col.getAlpha());
sqr.setOpaque(true);
sqr.setBackground(playColor);
sqr.setLayout(null);
...
When I click on any JLabel (mouseClicked(MouseEvent e)) I ...