FileDocCategorySizeDatePackage
NumberButton.javaAPI DocExample906Tue Dec 12 18:58:42 GMT 2000bingo.player

NumberButton

public class NumberButton extends JToggleButton

Fields Summary
protected static Font
font
protected static ImageIcon
selectedIcon
protected static ImageIcon
invisibleIcon
Constructors Summary
NumberButton(String label)

	super(label);
	setHorizontalTextPosition(AbstractButton.CENTER);
	setFocusPainted(false);
	setBorderPainted(false);

	if (font == null) {
	    font = new Font("serif", Font.BOLD, 24);
 	}
	setFont(font);

	if (selectedIcon == null) {
	    selectedIcon = new ImageIcon("chit.gif");
	}
	setSelectedIcon(selectedIcon);

	/*
	 * No selected/pressed/rollover icons get shown unless
	 * the toggle button's default icon is non-null.  The 
	 * workaround is to create a transparent, full-sized icon 
	 * for the default icon.
	 */
	if (invisibleIcon == null) {
	    invisibleIcon = new ImageIcon("invisible.gif");
	}
	setIcon(invisibleIcon);
    
Methods Summary