2
* Copyright (C) 2008 Fadi Al-katout (cutout) <cutout33@gmail.com>
4
* Monajat is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public Licence as published by the
6
* Free Software Foundation; either version 2 of the Licence,
7
* or(at your option) any later version.
9
* Monajat is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public Licence for more details.
14
* You should have received a copy of the GNU General Public Licence
16
* if not, write to the Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20
package monajat.gui.main;
23
import javax.swing.SwingUtilities;
24
import javax.swing.UIManager;
25
import javax.swing.plaf.FontUIResource;
27
public final class GuiFontSetter {
30
public static void adjustFont(MonajatPreferences pPreferences) {
31
Object[] objs = UIManager.getLookAndFeel().getDefaults().keySet().toArray();
32
for (int i = 0; i < objs.length; i++) {
33
if (objs[i].toString().toUpperCase().indexOf(".FONT") != -1) {
34
Font font = UIManager.getFont(objs[i]);
35
font = new Font("Times New Roman", Font.PLAIN, 13);
36
UIManager.put(objs[i], new FontUIResource(font));
39
SwingUtilities.updateComponentTreeUI(pPreferences);
40
pPreferences.repaint();