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

public class RenkFont2D extends JApplet {
   
    private int kirmizi,yesil,mavi; 
   
    public void init() 
    {
        kirmizi=100;
        yesil=255;
        mavi=125; 
        setBackground(new Color(0,0,255));
        setForeground(new Color(kirmizi,yesil,mavi));
    }

   
    public void paint(Graphics g) 
    {
        Graphics2D g2 = (Graphics2D) g;       
        g2.setColor(new Color(kirmizi,yesil,mavi)); 
        setBackground(new Color(0,0,255)); 
        Font font=g2.getFont();
        g2.setFont(new Font(font.getName(),Font.BOLD,24)); 
        g2.drawString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",50,33); 
        g2.drawString("Su andaki font : "+g.getFont(),50,70);
        g2.setFont(new Font(font.getName(),Font.PLAIN,12));     
        g2.drawString("Su andaki font : "+g.getFont(),50,85);
   }

    public static void main(String s[]) {
        JFrame f = new JFrame("RenkFont2D");
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        });
        JApplet applet = new RenkFont2D();
        f.getContentPane().add("Center", applet);
        applet.init();
        f.pack();
        f.setSize(new Dimension(550,200));
        f.show();
    }

}
