Java Swing Font Set setDefaultFont(final Font font)

Here you can find the source of setDefaultFont(final Font font)

Description

set Default Font

License

Open Source License

Declaration

public static void setDefaultFont(final Font font) 

Method Source Code

//package com.java2s;
/*/*  w w  w  .  j  a v a  2 s  . c o m*/
 * Java Common Library
 * Copyright (c) 2008 BitCtrl Systems GmbH
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 3.0 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 *
 * Contact Information:
 * BitCtrl Systems GmbH
 * Wei?enfelser Stra?e 67
 * 04229 Leipzig
 * Phone: +49 341-490670
 * mailto: info@bitctrl.de
 */

import java.awt.Font;

import javax.swing.UIDefaults;
import javax.swing.UIManager;

public class Main {

    public static void setDefaultFont(final Font font) {
        UIDefaults uiDefaults = UIManager.getDefaults();
        uiDefaults.put("TabbedPane.font", font);
        uiDefaults.put("Button.font", font);
        uiDefaults.put("List.font", font);
        uiDefaults.put("PasswordField.font", font);
        uiDefaults.put("TableHeader.font", font);
        uiDefaults.put("Table.font", font);
        uiDefaults.put("ToggleButton.font", font);
        uiDefaults.put("Checkbox.font", font);
        uiDefaults.put("Menu.font", font);
        uiDefaults.put("Text.font", font);
        uiDefaults.put("TextField.font", font);
        uiDefaults.put("Label.font", font);
        uiDefaults.put("Panel.font", font);
        uiDefaults.put("PopupMenu.font", font);
        uiDefaults.put("ToolBar.font", font);
        uiDefaults.put("ColorChooser.font", font);
        uiDefaults.put("MenuBar.font", font);
        uiDefaults.put("ProgressBar.font", font);
        uiDefaults.put("TextArea.font", font);
        uiDefaults.put("JTextArea.font", font);
        uiDefaults.put("ToolTip.font", font);
        uiDefaults.put("ComboBox.font", font);
        uiDefaults.put("MenuItem.font", font);
        uiDefaults.put("RadioButton.font", font);
        uiDefaults.put("Tree.font", font);
        uiDefaults.put("EditorPane.font", font);
        uiDefaults.put("JOptionPane", font);
        uiDefaults.put("ScrollPane.font", font);
        uiDefaults.put("TextPane.font", font);
        uiDefaults.put("TitledBorder.font", font);
        uiDefaults.put("FormattedTextField.font", font);
        uiDefaults.put("Dialog.font", font);
        uiDefaults.put("Frame.font", font);
        uiDefaults.put("Window.font", font);
        uiDefaults.put("Component.font", font);
        uiDefaults.put("OptionPane.font", font);
    }
}

Related

  1. increaseLabelFont(JLabel label, int offset)
  2. initGlobalFontSetting()
  3. setAntiAlisingFont()
  4. setBorderFromFont(JComponent c)
  5. setComponentsFont(Container container, Font font)
  6. setDefaultFont(Font font)
  7. setDefaultFont(java.awt.Font font)
  8. setFont(@Nonnull final Font font)
  9. setFont(Container container)