Java applet test

Shadow2531

[H]ard|Gawd
Joined
Jun 13, 2003
Messages
1,670
I created a little java applet for testing.

Code:
import java.applet.Applet;
import java.awt.*;

public class JavaAppletTest extends Applet {
    public void paint(Graphics g) {
        setBackground(Color.black);
        g.setColor(Color.white);
        g.drawString("Java Applet Loaded Successfully", 10, 20);
    }
}

I really don't know java that well. Did I do anything evil there? Derived that method from java.sun.com examples. The applet works as expected, but that doesn't mean anything.

I'm building the applet with gcj -C JavaAppletTest.java , which spits out the class file.

Thanks.
 
Shadow2531 said:
I really don't know java that well. Did I do anything evil there?

Using Java by itself is pretty evil. You probably won't go to hell, but purgatory might awaits you :eek:

j/k :p

Shadow2531 said:
Derived that method from java.sun.com examples. The applet works as expected, but that doesn't mean anything.

I'm having a hard time trying to figure out your question. I even tried you piece of code, and it works wonderfully... So what's your question/problem?
 
It's been awhile since I used Java, but maybe you should get in the habit of using JApplet and Swing instead of Applet? JApplet provides more functionality, and I'd imagine the 'newer' improved way of using Java.
 
If you are going to be using graphics in Java I would suggest you learn how to implement double buffering
 
Back
Top