1 | private static final class FontButtonListener implements ActionListener↵ | | 1 | private static final class FontButtonListener implements ActionListener↵
|
2 | {↵ | | 2 | {↵
|
3 | public void actionPerformed(ActionEvent evt)↵ | | 3 | public void actionPerformed(ActionEvent evt)↵
|
4 | {↵ | | 4 | {↵
|
5 | if (evt.getSource() instanceof FontButton)↵ | | 5 | if (evt.getSource() instanceof FontButton)↵
|
6 | {↵ | | 6 | {↵
|
7 | FontButton btn = (FontButton) evt.getSource();↵ | | 7 | FontButton btn = (FontButton) evt.getSource();↵
|
8 | FontInfo fi = btn.getFontInfo();↵ | | 8 | FontInfo fi = btn.getFontInfo();↵
|
9 | Font font = null;↵ | | 9 | Font font = null;↵
|
10 | if (fi != null)↵ | | 10 | if (fi != null)↵
|
11 | {↵ | | 11 | {↵
|
12 | font = fi.createFont();↵ | | 12 | font = fi.createFont();↵
|
13 | }↵ | | 13 | }↵
|
14 | font = new FontChooser().showDialog(font);↵ | | 14 | font = new FontChooser().showDialog(font);↵
|
15 | if (font != null)↵ | | 15 | if (font != null)↵
|
16 | {↵ | | 16 | {↵
|
17 | btn.setSelectedFont(font);↵ | | 17 | btn.setSelectedFont(font);↵
|
18 | btn._lbl.setText(new FontInfo(font).toString());↵ | | 18 | btn._lbl.setText(new FontInfo(font).toString());↵
|
19 | | | 19 |
|