Java JComponent Size isSmallSizeVariant(JComponent c)

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

Description

Returns true, if the component should use the small appearance.

License

Open Source License

Parameter

Parameter Description
c a parameter

Return

true, , if the component should use the small appearance.

Declaration

public static boolean isSmallSizeVariant(JComponent c) 

Method Source Code


//package com.java2s;
/*/*from  www  .j av  a 2s. co m*/
 * @(#)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 java.awt.*;

import javax.swing.*;

public class Main {
    /**
     * Returns true, if the component should use the small appearance.
     * @param c
     * @return true, , if the component should use the small appearance.
     */
    public static boolean isSmallSizeVariant(JComponent c) {
        Font f = c.getFont();
        if (f != null && f.getSize() <= 11) {
            return true;
        }
        String p = (String) c.getClientProperty("JComponent.sizeVariant");
        return p != null && p.equals("small");
    }
}

Related

  1. getValidatedSize(Component c, int sizeflag)
  2. getViewableScreenSize()
  3. getVisibleSizeInViewport(Component c)
  4. getWindowSize(JComponent start)
  5. inset(Component c, int insetSizeHor, int insetSizeVert)
  6. makeEqualSize(JComponent reference, JComponent... others)
  7. makeSameSize(Component... components)
  8. makeSameSize(JComponent... comps)
  9. makeSameSize(JComponent[] comps)