// Autor: João Matheus Santos Assis
import java.awt.GraphicsEnvironment;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
public class Fontes extends JFrame{
// Obtêm todas as fontes do sistema
private String[] font = GraphicsEnvironment.getLocalGraphicsEnvironment().
getAvailableFontFamilyNames();
private JList List = new JList(font);
public Fontes() {
super("Fontes");
add(new JScrollPane(List));
this.setSize(400,700);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
public static void main(String [] args){
new Fontes();
}
}
Palavras-Chaves: Fontes, Sistema, JList, Java.
Feito no NetBeans-5.5.1 | Executável |