本文整理了Java中javax.swing.JLayeredPane.print()
方法的一些代码示例,展示了JLayeredPane.print()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLayeredPane.print()
方法的具体详情如下:
包路径:javax.swing.JLayeredPane
类名称: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 );
}
内容来源于网络,如有侵权,请联系作者删除!