Java JButton Settings setButtonStyle(AbstractButton btn)

Here you can find the source of setButtonStyle(AbstractButton btn)

Description

set Button Style

License

Academic Free License

Declaration

public static void setButtonStyle(AbstractButton btn) 

Method Source Code


//package com.java2s;
//License from project: Academic Free License 

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;

import javax.swing.AbstractButton;

public class Main {
    public static Color BACKGROUND = new Color(35, 34, 32);
    public static Color BASIC_BUTTON_COLOR = new Color(255, 94, 5);
    private static Font BASIC_FONT = null;

    public static void setButtonStyle(AbstractButton btn) {
        getBasicFont();//from   w  w w .java  2  s.c o m
        btn.setFont(BASIC_FONT);
        btn.setForeground(BASIC_BUTTON_COLOR);
        btn.setBackground(BACKGROUND);
    }

    public static Font getBasicFont() {
        if (BASIC_FONT == null) {
            BASIC_FONT = Font.getFont("Verdana");
        }
        return BASIC_FONT;
    }

    public static void setBackground(Component comp) {
        comp.setBackground(BACKGROUND);
    }
}

Related

  1. setBtnValue(ButtonGroup group, String value)
  2. setButton(AbstractButton button, Icon icon, ActionListener buttonListener)
  3. setButtonContentMargin(AbstractButton button, Insets margin)
  4. setButtonInsetsRecursive(Insets insets, Container container)
  5. setButtonSelected(ButtonGroup buttonGroup, int selected)
  6. setButtonText(ButtonGroup buttonGroup, List texts)
  7. setHelpIDString(javax.swing.AbstractButton btn, String id)
  8. setHorizontalMargin(AbstractButton button, int hMargin)
  9. setImageIcon(AbstractButton abstractButton, URL url)