backgroundbutton.java.bak

来自「本系统充分利用了Java语言的平台无关性等众多优点」· BAK 代码 · 共 32 行

BAK
32
字号
package wodqq;/** * <p>Title: MyQQ</p> * <p>Description: MyQQ</p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company:  南昌大学软件学院 04级网通1班</p> * @author 张利彬 * @version 1.0 */import java.awt.Graphics;import java.awt.Graphics2D;import javax.swing.ImageIcon;import javax.swing.JPanel;import javax.swing.*;public class BackGroundButton extends JButton {  private ImageIcon imageIcon;  public BackGroundButton (ImageIcon imageIcon) {    this .imageIcon = imageIcon;  } public BackGroundButton(){ } public void paintComponent(Graphics g){   super.paintComponents(g);   Graphics2D g2d = (Graphics2D)g;   g2d.drawImage(imageIcon.getImage(),0,0,                 imageIcon.getIconWidth(),                 imageIcon.getIconHeight(),this); }}

⌨️ 快捷键说明

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