Wednesday, 11 December 2013

Graphic java course Using Font in Applet [ Part 5 ]

Using Font 
============



Source code
------------------------
       

import java.applet.Applet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
/**
 *
 * @author
 */
public class TestApplet extends Applet{

     Font f;
    public void init()
    {
       setBackground(Color.red);
       f=new Font("Arial",Font.ITALIC+Font.BOLD,12);
        }
    
    public void paint (Graphics g){
       setForeground(Color.BLUE);
        g.setFont(f);
        g.drawString("Applet", 100, 100);
                }
}
        
    

0 Comments:

Post a Comment

Facebook Twitter Delicious Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes