Java Set Font Kullanımı
Set font:
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import javax.swing.JApplet;
public class NewJApplet1 extends JApplet {
public void paint(Graphics g) {
Font t = new Font("Bradley Hand ITC", Font.TRUETYPE_FONT, 20);
Font r = new Font("Bodoni MT Poster Compressed", Font.BOLD, 20);
Font a = new Font("Algerian", Font.LAYOUT_NO_START_CONTEXT, 20);
Font b = new Font("Blackadder ITC", Font.PLAIN, 20);
Font z = new Font("Arabic Typesetting", Font.CENTER_BASELINE, 20);
Font o = new Font("Book Antiqua", Font.ITALIC, 20);
Font n = new Font("Book Antiqua", Font.TYPE1_FONT, 20);
for (int ts = 0; ts < 150; ts += 70) {
g.setColor(new Color(ts++));
g.setFont(t);
g.drawString("Trabzonspor", 15, 20);
g.setColor(Color.BLUE);
g.setFont(r);
g.drawString("Fenerbahçe", 15, 50);
g.setColor(Color.MAGENTA);
g.setFont(a);
g.drawString("Galatasaray", 15, 70);
g.setColor(Color.ORANGE);
g.setFont(b);
g.drawString("Besiktas", 15, 90);
g.setColor(Color.RED);
g.setFont(z);
g.drawString("Kayserispor", 15, 110);
g.setColor(Color.PINK);
g.setFont(o);
g.drawString("Ankaragücü", 15, 130);
g.setColor(Color.CYAN);
g.setFont(n);
g.drawString("GençlerBirliği", 15, 150);
setBackground(Color.YELLOW);
}
}
}
Yorumunuzu Ekleyin