hi! Here again!
I have this glass panel, wich it´s not actually working...
I mean.. the panel avoid to user get the components behind, but is not showing the label, and the opacity, and the color i´ve setted on it.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
MyGlassPane glassPane = new MyGlassPane();
glassPane.setOpaque(true);
// JFrame f = (JFrame)WindowManager.getDefault().getMainWindow();
// f.setGlassPane(glassPane);
JRootPane root SwingUtilities.getRootPane(component.getPanel().getParent());
root.setGlassPane(glassPane);
root.getGlassPane();
glassPane.setEnabled(true);
glassPane.setVisible(true);
}
class MyGlassPane extends JComponent {
public MyGlassPane(){
JLabel lbl = new JLabel();
lbl.setIcon((new javax.swing.ImageIcon(getClass().getResource("/org/myorg/guimodule/images/ajax-loader3.gif"))));
this.add(lbl);
lbl.setVisible(true);
this.setOpaque(true);
}
public void paint(Graphics g) {
super.paintComponent(g);
g.setColor(new Color (255,255,255,100));
}
}
what i´m doing wrong?
