// Somewhere in the code we get the graphics object m_componentGraphics.getGraphics(); // Draw the new frontbuffer to the screen m_componentGraphics.drawImage( m_frontBuffer, 0, 0, null );But for some reason if I make my graphics engine a subclass of java.awt.Canvas everything works again. The above code works just fine in Java 1.1 within a Component subclass. It smells like something has been changed in the AWT's peer system between Java 1.1 and Java 2. Does anyone know what causes this behaviour? Edited by - javanerd on 4/4/00 2:10:40 PM
[java] Repaint in Java 2
Started by javanerd, Apr 04 2000 08:10 AM
1 reply to this topic
#1 Members - Reputation: 122
Posted 04 April 2000 - 08:10 AM
I just noticed that in Java 2 the painting doesn't work in a java.awt.Component subclass with the following code:
Sponsor:
#2 Members - Reputation: 122
Posted 05 April 2000 - 02:57 AM
java.awt.Component doesn''t have a drawImage method. If those two lines are your actuall code, then it is simply a matter of doing
Graphics m_componentGraphics = m_component.getGraphics();
The graphics class does not have a getGraphics() methods.
If that is not really your problem, the only thing I can think of is that Canvas'' paint() overrides Component''s paint. There might be a difference there. Also, try java.awt.Component.updateImage() instead of java.awt.Graphics.drawImage(); That might do the trick.
Graphics m_componentGraphics = m_component.getGraphics();
The graphics class does not have a getGraphics() methods.
If that is not really your problem, the only thing I can think of is that Canvas'' paint() overrides Component''s paint. There might be a difference there. Also, try java.awt.Component.updateImage() instead of java.awt.Graphics.drawImage(); That might do the trick.






