skip to main | skip to sidebar

Java Programs and Examples with Output

Pages

▼
 
  • RSS
  • Twitter
Saturday, October 13, 2012

How to know which fonts are available in a local system

Posted by Raju Gupta at 5:00 AM – 0 comments
 
This Program will helps to know which fonts are available in our system

import java.awt.*;
class Fonts
  {
     public static void main(String args[])
         {
            //get the local graphics environment info into object ge

          GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();

           String fonts[]=ge.getAvailableFontFamilyNames();

           System.out.println("Available fonts on this system:");
 
          for(int i=0; i < fonts.length;i++)
            System.out.println(fonts[i]);

                 }
      }


Labels: Java AWT Example

Leave a Reply

Newer Post Older Post
Subscribe to: Post Comments ( Atom )
  • Popular
  • Recent
  • Archives
Powered by Blogger.
 
 
 
© 2011 Java Programs and Examples with Output | Designs by Web2feel & Fab Themes

Bloggerized by DheTemplate.com - Main Blogger