Java JButton Settings updateSize(AbstractButton button, Dimension size)

Here you can find the source of updateSize(AbstractButton button, Dimension size)

Description

update Size

License

Open Source License

Declaration

private static void updateSize(AbstractButton button, Dimension size) 

Method Source Code


//package com.java2s;

import java.awt.Dimension;

import javax.swing.AbstractButton;
import javax.swing.Icon;

public class Main {
    private static void updateSize(AbstractButton button, Dimension size) {
        Icon icon = button.getIcon();

        if (icon != null) {
            size.width = Math.max(size.width, icon.getIconWidth());
            size.height = Math.max(size.height, icon.getIconHeight());
        }/*from  w  w w  . java 2 s.co  m*/
    }
}

Related

  1. showOptions(int width, int type, String title, String text, Object... buttons)
  2. styleButton(final AbstractButton btn)
  3. toBold(final T button)
  4. tryToBuildAFocusGroup(AbstractButton... buttons)
  5. unifiedButtonLookAndFeel(JComponent b)
  6. useOptimizedCustomButtonPainting()