public TransparentGlassPanePanel(ImageIcon icon,String text,Color backgroundColor,float transparency){
  setLayout(new GridBagLayout());
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.gridy=0;
  gbc.gridx=0;
  JLabel iconLabel=new JLabel(icon);
  add(iconLabel,gbc);
  gbc.gridy+=1;
  label=new JLabel(text);
  add(label,gbc);
  if (transparency > 1) {
    transparency=1;
  }
 else   if (transparency < 0) {
    transparency=0;
  }
  Color transparentColor=new Color(backgroundColor.getRed(),backgroundColor.getGreen(),backgroundColor.getBlue(),(int)(transparency * 255));
  setBackground(transparentColor);
  setOpaque(false);
}

public TransparentGlassPanePanel ( ImageIcon icon , String text , Color backgroundColor , float transparency ) { setLayout ( new GridBagLayout ( ) ) ; GridBagConstraints gbc = new GridBagConstraints ( ) ; gbc . gridy = 0 ; gbc . gridx = 0 ; JLabel iconLabel = new JLabel ( icon ) ; add ( iconLabel , gbc ) ; gbc . gridy += 1 ; label = new JLabel ( text ) ; add ( label , gbc ) ; if ( transparency > 1 ) { transparency = 1 ; } else if ( transparency < 0 ) { transparency = 0 ; } Color transparentColor = new Color ( backgroundColor . getRed ( ) , backgroundColor . getGreen ( ) , backgroundColor . getBlue ( ) , ( int ) ( transparency * 255 ) ) ; setBackground ( transparentColor ) ; setOpaque ( false ) ; }
creates a transparent panel with a loading icon and a text .
