Java JButton Settings emphasizeButton(AbstractButton btn)

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

Description

Try to switch the background and foreground colors.

License

Academic Free License

Parameter

Parameter Description
btn a parameter

Declaration

public static void emphasizeButton(AbstractButton btn) 

Method Source Code


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

import java.awt.Color;

import javax.swing.AbstractButton;

public class Main {
    /**//from   ww  w  . j av  a2  s . c o  m
     * Try to switch the background and foreground colors.
     * 
     * @param btn
     */
    public static void emphasizeButton(AbstractButton btn) {

        Color col = btn.getBackground();
        btn.setBackground(btn.getForeground());
        btn.setForeground(col);
    }
}

Related

  1. doHover(boolean b, AbstractButton... btns)
  2. doSetText(final AbstractButton abstractButton, final String text)
  3. doSetTextInEDT(final AbstractButton abstractButton, final String text)
  4. drawActiveButtonBorder(Graphics g, int x, int y, int w, int h)
  5. drawDefaultButtonBorder(Graphics g, int x, int y, int w, int h, boolean active)
  6. equalizeButtonSizes(JPanel jPanelButtons)
  7. filterMnemonic(final String s, final AbstractButton b)
  8. findButton(Container container, String text)
  9. findButtonComponents(Container container, String label)