import java.awt.*;
import javax.swing.*;

public class Hello extends JApplet {

public void init() {
    Container contentPane = getContentPane();
    contentPane.setLayout(new FlowLayout());
    JPanel panel = new MainPanel();
    getContentPane().add(panel);
}
}

class MainPanel extends JPanel {

    MainPanel() {
        setBackground(Color.black);
        JLabel label = new JLabel ("hello, world!");
        label.setFont(new Font(null, Font.BOLD, 40));
        label.setForeground(Color.red);
        add(label);
    }
}