javax.swing.JLayeredPane.print()方法的使用及代码示例

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

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

JLayeredPane.print介绍

暂无

代码示例

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

protected void paintComponent( Graphics g )
{
 super.paintComponent( g );
 if( !_modalComponents.isEmpty() )
 {
  JRootPane rootPane = SwingUtilities.getRootPane( this );
  if( rootPane != null )
  {
   rootPane.getLayeredPane().print( g );
  }
 }
}

代码示例来源:origin: com.numdata/numdata-swing

@Override
protected void paintComponent( final Graphics g )
{
  // Explicitly paint the layered pane, because it was made invisible.
  final JRootPane rootPane = SwingUtilities.getRootPane( this );
  if ( rootPane != null )
  {
    // It is important to call print() instead of paint() here
    // because print() doesn't affect the window's double buffer
    final JLayeredPane layeredPane = rootPane.getLayeredPane();
    layeredPane.print( g );
  }
  final Graphics2D g2d = (Graphics2D)g;
  final Paint oldPaint = g2d.getPaint();
  g2d.setColor( getBackground() );
  g2d.fillRect( 0, 0, getWidth(), getHeight() );
  g2d.setPaint( oldPaint );
}

相关文章