⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 numberbutton.java

📁 初级学习资料必读本
💻 JAVA
字号:
package bingo.player;import java.awt.*;import javax.swing.*;import javax.swing.event.*;class NumberButton extends JToggleButton {    static protected Font font;    static protected ImageIcon selectedIcon, invisibleIcon;    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);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -