Tuesday 13 May 2014

In The Following Code Shows How to Use Font.toString() Method.

Created By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
--------------------------------------------------------------------
In The Following Code Shows How to Use Font.toString() Method.
--------------------------------------------------------------------

=======================================
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JFrame;
fb.com/keepprogramming
public class Main extends JFrame {

public static void main(String[] a) {
Main f = new Main();
f.setSize(300, 300);
f.setVisible(true);
}

public void paint(Graphics g) {
Font f = g.getFont();

System.out.println(f.toString());



g.drawString("java2s.com", 4, 16);
}
}

0 comments:

Post a Comment