javax.swing.JFrame.getGlassPane()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中javax.swing.JFrame.getGlassPane()方法的一些代码示例,展示了JFrame.getGlassPane()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.getGlassPane()方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:getGlassPane

JFrame.getGlassPane介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

((JFrame) w).getGlassPane().setVisible(false);

代码示例来源:origin: girtel/Net2Plan

private void bringToFront()
  {
    consoleDialog.getGlassPane().setVisible(!consoleDialog.getGlassPane().isVisible());
    consoleDialog.toFront();
    /* Note: Calling repaint explicitly should not be necessary */
  }
});

代码示例来源:origin: vgrazi/java-concurrent-animated

private void clearFrame() {
  if (backgroundImage != null) {
   container.remove(backgroundImage);
   backgroundImage = null;
  }
  if (examplePanel != null) {
   container.remove(examplePanel);
   backgroundImage = null;
  }
  if (imagePanel != null) {
   container.remove(imagePanel);
   imagePanel = null;
  }
  int componentCount = ((Container) frame.getGlassPane()).getComponentCount();
  if (componentCount > 0) {
//      System.out.printf("ConcurrentExampleLauncher.clearFrame contains %d elements. Removing first %s%n", componentCount, ((Container) frame.getGlassPane()).getComponents()[0]);
   ((Container) frame.getGlassPane()).remove(0);
  }
 }

代码示例来源:origin: antlr/antlrworks

public Component getGlassPane() {
  if(useDesktop) {
    return jInternalFrame.getGlassPane();
  } else {
    return jFrame.getGlassPane();
  }
}

代码示例来源:origin: Vhati/Slipstream-Mod-Manager

@Override
  public boolean dispatchKeyEvent( KeyEvent e ) {
    Object source = e.getSource();
    if ( source instanceof Component == false ) return false;
    Window ancestor = SwingUtilities.getWindowAncestor( (Component)source );
    if ( ancestor instanceof JFrame == false ) return false;
    return ( InertPanel.this == ((JFrame)ancestor).getGlassPane() );
  }
};

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-misc-swing

public void installPane(JFrame frame) {
  this.oldGlassPane = frame.getGlassPane();
  this.frame = frame;
  frame.setGlassPane(this);
}

代码示例来源:origin: stackoverflow.com

JFrame frame = new JFrame();
Component glassPane = frame.getGlassPane();
glassPane.addMouseListener(myListener);

代码示例来源:origin: stackoverflow.com

JFrame frame = new JFrame();
frame.setGlassPane( new FreePane() );
frame.getGlassPane().setVisible(true);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-team-commons

@Override
  public void run() {
    JFrame mainWindow = (JFrame) WindowManager.getDefault().getMainWindow();
    mainWindow
      .getGlassPane()
      .setCursor(Cursor.getPredefinedCursor(
        on ?
        Cursor.WAIT_CURSOR :
        Cursor.DEFAULT_CURSOR));
    mainWindow.getGlassPane().setVisible(on);
  }
};

代码示例来源:origin: eu.agrosense.spi/session

@Override
  public void run() {
    //
    // store origional glasspane
    //
    log.finest("store origional glasspane");
    final JFrame mainWin = (JFrame) WindowManager.getDefault().getMainWindow();
    orgGlassPane = mainWin.getGlassPane();
  }
});

代码示例来源:origin: igniterealtime/Spark

public void mouseClicked(MouseEvent mouseEvent) {
    parent.setGlassPane(glassPane);
    parent.getGlassPane().setVisible(false);
    contactField.dispose();
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject

@Override
public void run() {
  assert EventQueue.isDispatchThread();
  try {
    JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow();
    Component component = frame.getGlassPane();
    component.setVisible(show);
    component.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
  } catch (NullPointerException npe) {
    LOGGER.log(Level.WARNING, null, npe);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-extension-openide

private static void doShowBusyCursor(boolean busy) {
    JFrame mainWindow = (JFrame)WindowManager.getDefault().getMainWindow();
    if(busy){
      RepaintManager.currentManager(mainWindow).paintDirtyRegions();
      mainWindow.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      mainWindow.getGlassPane().setVisible(true);
      mainWindow.repaint();
    } else {
      mainWindow.getGlassPane().setVisible(false);
      mainWindow.getGlassPane().setCursor(null);
      mainWindow.repaint();
    }
  }
// </rave>

代码示例来源:origin: igniterealtime/Spark

public void windowClosing(WindowEvent windowEvent) {
  parent.setGlassPane(glassPane);
  parent.getGlassPane().setVisible(false);
  contactField.dispose();
  parent.removeWindowListener(this);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

public void run () {
    try {
      JFrame f = (JFrame)WindowManager.getDefault ().getMainWindow ();
      Component c = f.getGlassPane ();
      c.setVisible (true);
      c.setCursor (Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR));
    } catch (NullPointerException npe) {
      ErrorManager.getDefault ().notify (ErrorManager.INFORMATIONAL, npe);
    }
  }
});

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

public void run () {
    try {
      JFrame f = (JFrame)WindowManager.getDefault ().getMainWindow ();
      Component c = f.getGlassPane ();
      c.setCursor (null);
      c.setVisible (false);
    } catch (NullPointerException npe) {
      ErrorManager.getDefault ().notify (ErrorManager.INFORMATIONAL, npe);
    }
  }
});

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

public void startDrag(DockableDragSource source) {
  if(isDragStarted || source == null) {
    // safety checks
    return;
  }
  Window aboveWindow = this.window;
  isDragStarted = true;
  if(aboveWindow instanceof JFrame) {
    oldGlassPane = ((JFrame) aboveWindow).getGlassPane();
    oldGlassPaneVisible = oldGlassPane.isVisible();
    ((JFrame) aboveWindow).setGlassPane(dragGlassPane);
    dragGlassPane.setVisible(true);
  } else if(aboveWindow instanceof JDialog) {
    oldGlassPane = ((JDialog) aboveWindow).getGlassPane();
    oldGlassPaneVisible = oldGlassPane.isVisible();
    ((JDialog) aboveWindow).setGlassPane(dragGlassPane);
    dragGlassPane.setVisible(true);
  }
}

代码示例来源:origin: de.sciss/scisslib

protected void deactivateHelpMode()
{
  if( f.getGlassPane() != this ) return;
  this.setVisible( false );
  f.setGlassPane( normalGlassPane );
  f.setFocusTraversalPolicy( normalFocus );
  normalGlassPane         = null;
  normalFocus                = null;
  focussedHelpComponent   = null;
  focussedArea.reset();
  f.requestFocus();
}

代码示例来源:origin: de.sciss/scisslib

protected void activateHelpMode()
{
  Component recentGlassPane = f.getGlassPane();
  if( recentGlassPane == this || recentGlassPane.isVisible() ) return;
  normalGlassPane         = recentGlassPane;
  focussedHelpComponent   = null;
  focussedArea.reset();
  f.setGlassPane( this );
  this.setVisible( true );
  normalFocus                = f.getFocusTraversalPolicy();
  f.setFocusTraversalPolicy( new NoFocusTraversalPolicy() );
  this.requestFocus();
}

代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common

/**
 * Ajoute un glasspane  l'application.
 */
public void setGlassPaneStop() {
 if (glassPaneStop_ == null) {
  glassPaneStop_ = new BuGlassPaneStop();
  ((JFrame) getFrame()).setGlassPane(glassPaneStop_);
  glassPaneStop_.setVisible(true);
  return;
 }
 final Component glasspane = ((JFrame) getFrame()).getGlassPane();
 if ((glasspane == null) || (glasspane != glassPaneStop_)) {
  ((JFrame) getFrame()).setGlassPane(glassPaneStop_);
 }
 glassPaneStop_.setVisible(true);
}

相关文章

JFrame类方法