Java Code Examples for javax.swing.JFrame.getGlassPane()

The following are Jave code examples for showing how to use getGlassPane() of the javax.swing.JFrame class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: incubator-netbeans   File: ModeResizer.java   View Source Code Vote up 6 votes
private void start() {
    Toolkit.getDefaultToolkit().addAWTEventListener( this, KeyEvent.KEY_EVENT_MASK );
    TopComponent.getRegistry().addPropertyChangeListener( this );
    
    Window w = SwingUtilities.getWindowAncestor( resizingComponent );
    if( w instanceof JFrame ) {
        frame = ( JFrame ) w;
        oldGlass = frame.getGlassPane();
        glass = new GlassPane( resizingComponent );
        frame.setGlassPane( glass );
        glass.setVisible( true );
        glass.invalidate();
        glass.revalidate();
        glass.repaint();
        glass.refresh();
        
    }
}
 
Example 2
Project: incubator-netbeans   File: ProjectUtilities.java   View Source Code Vote up 5 votes
@Override
public void run() {
    try {            
        JFrame f = (JFrame)WindowManager.getDefault ().getMainWindow ();
        Component c = f.getGlassPane ();
        c.setVisible ( show );
        c.setCursor (show ? Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR) : null);
    } 
    catch (NullPointerException npe) {
        Exceptions.printStackTrace(npe);
    }
}
 
Example 3
Project: incubator-netbeans   File: PleaseWait.java   View Source Code Vote up 5 votes
public void install() {
    JFrame frame = (JFrame) WindowManagerImpl.getInstance().getMainWindow();
    oldGlass = frame.getGlassPane();
    if( oldGlass instanceof PleaseWait )
        oldGlass = null;
    frame.setGlassPane( this );
    setVisible(true);
    invalidate();
    revalidate();
    repaint();
    
}
 
Example 4
Project: incubator-netbeans   File: CustomizerProviderImpl.java   View Source Code Vote up 5 votes
public void run() {
    try {
        JFrame f = (JFrame) WindowManager.getDefault().getMainWindow();
        Component c = f.getGlassPane();
        c.setVisible(show);
        c.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
    } catch (NullPointerException npe) {
        Exceptions.printStackTrace(npe);
    }
}
 
Example 5
Project: incubator-netbeans   File: CustomizerProviderImpl.java   View Source Code Vote up 5 votes
public void run() {
    try {
        JFrame f = (JFrame) WindowManager.getDefault().getMainWindow();
        Component c = f.getGlassPane();
        c.setVisible(show);
        c.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
    } catch (NullPointerException npe) {
        Exceptions.printStackTrace(npe);
    }
}