Java Swing UIManager applySizeVariant(JComponent c)

Here you can find the source of applySizeVariant(JComponent c)

Description

apply Size Variant

License

Open Source License

Declaration

public static void applySizeVariant(JComponent c) 

Method Source Code

//package com.java2s;
/*/*w ww . j  a  va 2  s .com*/
 * @(#)QuaquaUtilities.java  
 *
 * Copyright (c) 2003-2010 Werner Randelshofer
 * Hausmatt 10, Immensee, CH-6405, Switzerland.
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Werner Randelshofer. For details see accompanying license terms. 
 */

import javax.swing.*;

public class Main {
    public static void applySizeVariant(JComponent c) {
        String p = (String) c.getClientProperty("JComponent.sizeVariant");
        if (p == null) {
        } else if (p.equals("regular")) {
            c.setFont(UIManager.getFont("SystemFont"));
        } else if (p.equals("small")) {
            c.setFont(UIManager.getFont("SmallSystemFont"));
        } else if (p.equals("mini")) {
            c.setFont(UIManager.getFont("MiniSystemFont"));
        }
    }
}

Related

  1. adjustBackground(JComponent c)
  2. beep(Component comp)
  3. canChangeSize()
  4. clearErrorLabel(JLabel label)
  5. configureStandardUI()