Java JButton Settings getButtonSelectedInt(ButtonGroup buttonGroup)

Here you can find the source of getButtonSelectedInt(ButtonGroup buttonGroup)

Description

get Button Selected Int

License

Open Source License

Declaration

public static int getButtonSelectedInt(ButtonGroup buttonGroup) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.ButtonGroup;

public class Main {
    public static int getButtonSelectedInt(ButtonGroup buttonGroup) {
        try {//from w ww .  j a  va2 s.  com
            return Integer.parseInt(getButtonSelectedString(buttonGroup));
        } catch (NumberFormatException e) {
            return -1;
        }
    }

    public static String getButtonSelectedString(ButtonGroup buttonGroup) {
        return buttonGroup.getSelection().getActionCommand();
    }
}

Related

  1. getButtonAsLink(String text)
  2. getButtonBorderColor(Color color)
  3. getButtonColor()
  4. getButtonPane()
  5. getButtonSelectColor()
  6. getButtonSelectedString(ButtonGroup buttonGroup)
  7. getDefaultFatButtonMargin()
  8. getHudControlShadowSize(AbstractButton button)
  9. getIcon(AbstractButton b)