Here you can find the source of setButtonText(ButtonGroup buttonGroup, List
Parameter | Description |
---|---|
buttonGroup | ButtonGroup |
texts | List |
public static void setButtonText(ButtonGroup buttonGroup, List<Integer> texts)
//package com.java2s; //License from project: Apache License import java.util.Enumeration; import java.util.List; import javax.swing.AbstractButton; import javax.swing.ButtonGroup; public class Main { /**/*from ww w. j a v a2s . c o m*/ * setter method for button text. * * @param buttonGroup ButtonGroup * @param texts List */ public static void setButtonText(ButtonGroup buttonGroup, List<Integer> texts) { int index = 0; for (Enumeration<AbstractButton> buttons = buttonGroup.getElements(); buttons.hasMoreElements();) { AbstractButton button = buttons.nextElement(); button.setText(texts.get(index).toString()); index++; } } }