@@ -0,0 +1,1135 @@
+%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 tesNama 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/2;%0A        int yPusat = this.getSize().height/2;%0A        %0A        String nama = %22Nama: Agus Makmun%22;%0A        String nim = %22NIM: L200130113%22;%0A        String smt = %22Smt: Semester Empat%22;%0A%0A        FontMetrics fontMetrics = this.getFontMetrics(font);%0A        int posisiX = xPusat-(fontMetrics.stringWidth(nama)/2);%0A        //int posisiY = xPusat-(fontMetrics.stringWidth(nama)/2);%0A        //int posisiZ = xPusat-(fontMetrics.stringWidth(nama)/2);%0A        %0A        grafik.drawString(nama, posisiX, yPusat);%0A        grafik.drawString(nim, posisiX, yPusat+20);%0A        grafik.drawString(smt, posisiX, yPusat+40);%0A    %7D%0A%7D%0A

Create tesNama.java