How can I fade in a JPanel & children?
- by Christian 'fuzi' Orgler
I know that I can fade in a panel, by adding the alpha value to the background color & a timer. But how can I fade in a panel with child components (like a JLabel)?
EDIT
_fadeTimer = new Timer(40, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (_alpha == 255) {
_fadeTimer.stop();
} else {
pnl_hint.setBackground(new Color(
bgColor.getRed(),
bgColor.getGreen(),
bgColor.getBlue(),
(_alpha += 1)));
pnl_hint.updateUI();
}
}
});
_fadeTimer.start();