When I first bring up the web page, I get the wrong background color (it's actually the foreground color - black - instead, although that might be coincidence). Refreshing the page makes the background of the applet area the same color as the HTML page background. Then, when I go to another tab and return, the background of the applet area is whatever was in that area on the page of the last tab that I visited. I actually wouldn't mind if the background in the applet area was transparent right to the background of the HTML page, but only the HTML page in which is resides - not wherever I was before ...
Correlation does not prove causality.
Roger F. Gay
Ranch Hand
Joined: Feb 16, 2007
Posts: 348
posted
0
The problem occurred using Firefox, but was not repeatable in Opera. So, I'm guessing it's a Firefox bug. Anyone concur ? Disagree?
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
> Anyone concur ? Disagree?
to concur/disagree you would need to post the 'exact' code/steps that reproduces the problem.
1) You extend JApplet. In such scenarios (where you use Swing components) it is recommended to override paintComponent() for custom painting
2) In the init() you are invoking setBack/Foreground(). Later on you are also calling g2.fill. What exactly are you trying to do here?
3) Your class has a main method? Who is supposed to be invoking that?
4) Your main method creates a JFrame and you add an applet instance to it? What exactly are you trying to do here?