Different results firefox/chrome/ie

chimerical26's Avatar, Join Date: Dec 2010
Newbie Member
Hey there,
I am sure this is an issue every java novice comes up against when they start but my java applet is displaying completely differently in firefox than it is in Chrome and IE. It seems as though paint()/repaint isn't working in firefox because I get black text on a black background but when I drag another window over the applet the black background gets filled with the graphics from the window on top. Chrome and IE are fine. Any help?

import java.awt.*;

public class SalutonApplet extends javax.swing.JApplet {
    String greeting;

    public void init(){
        greeting = "Saluton mondo!";

    public void paint(Graphics screen){
        Graphics2D screen2D = (Graphics2D) screen;
        for(int i = 0;i<7;i++){
        screen2D.drawString(greeting, 100, 100);


    public void repaint( Graphics2D g ) {
      update( g );


Last edited by shabbir; 1Dec2010 at 09:39.. Reason: Code blocks
chimerical26's Avatar, Join Date: Dec 2010
Newbie Member
The html

<title>Saluton mondo!</title>
<body bgcolor="000000" Text="#FF00FF">
<p>This is a Java Applet.</p>
<applet code="SalutonApplet"
<p>You need a Java Enabled Browser to see this.</p>