KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > StubApp


1
2 import java.awt.Font JavaDoc;
3 import java.awt.GraphicsEnvironment JavaDoc;
4
5 /*
6  * (C) Copyright SimulacraMedia 2003. All rights reserved.
7  *
8  * Created on 30-Nov-2004
9  *
10  */

11
12 /**
13  * FIXME - Matthew Large DIDN'T GIVE ME A DESCRIPTION!!
14  *
15  * @author Matthew Large
16  * @version $Revision: 1.1 $
17  *
18  */

19 public class StubApp {
20
21     /**
22      *
23      */

24     public StubApp() {
25         super();
26     }
27
28     public void fontFind() {
29         GraphicsEnvironment JavaDoc g = GraphicsEnvironment
30                 .getLocalGraphicsEnvironment();
31
32         Font JavaDoc[] allFonts = g.getAllFonts();
33
34         String JavaDoc str = "abc???";
35
36         int x = 0;
37
38         for (x = 0; x < allFonts.length; x++) {
39
40             if (allFonts[x].canDisplayUpTo(str) == -1) {
41
42                 System.out.println(allFonts[x].getFontName());
43
44                 break;
45
46             }
47
48         }
49
50     }
51
52     public static void main(String JavaDoc[] args) {
53         StubApp app = new StubApp();
54         app.fontFind();
55     }
56 }
Popular Tags