Results 1 to 2 of 2
  1. #1
    SwinGirl is offline Member
    Join Date
    Nov 2007
    Posts
    24
    Rep Power
    0

    Exclamation GlassPane problem

    hi! Here again!
    I have this glass panel, wich its 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 ive setted on it.
    Java Code:
    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);
    
        }
    Java Code:
    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 im doing wrong? :(

  2. #2
    SwinGirl is offline Member
    Join Date
    Nov 2007
    Posts
    24
    Rep Power
    0

    Default

    well, ive fixed all things... My glassPane is visible.
    I have another problem now.
    Im using Netbeans wizard dramework, on Netbeans platform.
    The problem is... if the glassPane comes from root.. My root is the pltaform, not the wizard, so.. the glassPane is drawed on the platform background, and not on the wizard.
    How can i fix it..?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •