Exemplo n.º 1
0
  public void init(Object parent) {

    glass = new BlurGlass();
    glass.setLayout(null);

    this.setLayout(null);

    setOpaque(false);
    // getContentPane().setOpaque(false);
    this.getLayeredPane().setOpaque(false);
    this.getRootPane().setOpaque(false);
    // putClientProperty("Synthetica.opaque", Boolean.FALSE);

    JParent = parent;
    glass.setOpaque(false);

    MouseInputAdapter adapter = new MouseInputAdapter() {};
    glass.addMouseListener(adapter);
    glass.addMouseMotionListener(adapter);

    try {
      if (parent instanceof JFrame) {
        layer = ((JFrame) parent).getLayeredPane();
      } else if (parent instanceof JInternalFrame) {
        layer = ((JInternalFrame) parent).getLayeredPane();
      }
      glass.setBounds(layer.getBounds());

    } catch (NullPointerException err) {
      Dialogos.error("Error interno en Dialogo interno modal", err);
    }

    try {
      glass.add(this);
      layer.add(glass, JLayeredPane.DEFAULT_LAYER);
    } catch (NullPointerException err) {
      Dialogos.error("Error interno en dialogo modal interno", err);
    }
  }