@@ -0,0 +1,831 @@
+%0Aimport java.applet.Applet;%0Aimport java.awt.Color;%0Aimport java.awt.Font;%0Aimport java.awt.FontMetrics;%0Aimport java.awt.Graphics;%0A%0A/**%0A * @author agaust%0A * @blog bloggersmart.net%0A */%0Apublic class TesApplet extends Applet %7B%0A    private Object fontMetrics;%0A    @SuppressWarnings(%22empty-statment%22)%0A    @Override%0A    public void paint(Graphics grafik) %7B%0A        Font font = new Font(%22sanserif%22, Font.BOLD, 20);%0A        grafik.setFont(font);%0A        grafik.setColor(Color.blue);%0A        %0A        int xPusat = this.getSize().width/4;%0A        int yPusat = this.getSize().height/2;%0A        %0A        String ucapan = %22Selamat Belajar JAVA Applet%22;%0A        FontMetrics fontMetrics = this.getFontMetrics(font);%0A        int posisiX = xPusat-(fontMetrics.stringWidth(ucapan)/2);%0A        %0A        grafik.drawString(ucapan, xPusat, yPusat);%0A    %7D%0A%7D%0A

Create TesApplet.java