Hi,
I'm using some simple J2D in an applet with JDK and JRE version 1.4.1_02.
The applet is a meter with an image as its background and is working fine
other than initially the background isn't drawn on the screen. The
background is being drawn by overriding the paintcomponent method of a
JPanel and calling drawImage with a graphics 2D object
when the animations displayed in front of the background are drawn the
background appears fine or if another window is dragged infront of the
background it again is fine. I've tried putting invalidate();
validate();
paint(getGraphics) in both the start and the inits of the graphics but
that
hasn't helped. any ideas?
public abstract class MDAppletAbstract extends JApplet implements
Observer {
/******************SNIP*******************
JPanel myMDJPanel;
URL codeBase; //used for applet version only
public void init() {
// create the dial background
setContentPane(makeContentPane());
// start the message handler and the sockets
MDMessageHandler myMessageHandler = MDMessageHandler.getInstance();
myMDJPanel.invalidate();
myMDJPanel.validate();
myMDJPanel.paint(getGraphics());
}
public void start() {
// force repaint on the dial background
myMDJPanel.invalidate();
myMDJPanel.validate();
myMDJPanel.setVisible(true);
myMDJPanel.paint(getGraphics());
}
/******************SNIP*******************
any ideas..?
--
Lloyd Shove
[EMAIL PROTECTED]
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".