S
Soeren Meyer-Eppler
Hi everybody,
I'm new to Java programming and have two questions:
1) what is the difference between the Component methods paint, paintall,
print, printall?
2) How can I render a Component to an Image without showing it on
screen? I've tried the following code, which does render the JFrame to
the image, but only when I do a setVisible( true ) beforehand. I don't
want that because that causes it to be displayed on screen as well.
m_Frame = new JFrame();
// [omitted] add some stuff to the frame...
m_Frame.setVisible( true );
m_Image = new BufferedImage((int)getWidth(), (int)getHeight(),
BufferedImage.TYPE_INT_RGB );
m_Frame.paintAll( m_Image.createGraphics());
regards,
Sören
I'm new to Java programming and have two questions:
1) what is the difference between the Component methods paint, paintall,
print, printall?
2) How can I render a Component to an Image without showing it on
screen? I've tried the following code, which does render the JFrame to
the image, but only when I do a setVisible( true ) beforehand. I don't
want that because that causes it to be displayed on screen as well.
m_Frame = new JFrame();
// [omitted] add some stuff to the frame...
m_Frame.setVisible( true );
m_Image = new BufferedImage((int)getWidth(), (int)getHeight(),
BufferedImage.TYPE_INT_RGB );
m_Frame.paintAll( m_Image.createGraphics());
regards,
Sören