-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFont
42 lines (35 loc) · 1.09 KB
/
Font
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
/**
*
* @author onezer0
*/
public class Fontes1 extends JFrame {
public Fontes1() {
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setPreferredSize(new Dimension(800, 400));
setLocation(0, 400);
String[] listaDeFontes = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
int i = listaDeFontes.length;
getContentPane().setLayout(new FlowLayout());
JLabel jb;
Font f;
for (String listaDeFonte : listaDeFontes) {
jb = new JLabel("Aula 3 - " + listaDeFonte + " -XX");
f = new Font(listaDeFonte, Font.PLAIN, 14);
add(jb);
}
pack();
}
public static void main (String[] args) {
javax.swing.SwingUtilities.invokeLater(() -> {
Fontes1 fontes1 = new Fontes1();
fontes1.setVisible(true);
});
}
}