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

📄 block.java

📁 本文件包中包含了15个java课程设计。对java学习是很不错的。
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package memory;/** * * @author Administrator */import javax.swing.*;import java.awt.event.*;public class Block extends JButton implements ActionListener{ ImageIcon 翻开时的图标=null,关闭时的图标=null; public Block()  {    addActionListener(this);  }  public ImageIcon 获取翻开时的图标()  {    return 翻开时的图标;  }   public ImageIcon 获取关闭时的图标()  {    return 关闭时的图标;  }   public void 设置翻开时的图标(ImageIcon icon)  {    翻开时的图标=icon;  } public void 设置关闭时的图标(ImageIcon icon)  {    关闭时的图标=icon;  } public void 设置图标(ImageIcon icon)  {    setIcon(icon);      } public void actionPerformed(ActionEvent e)  {    this.setIcon(翻开时的图标);  }}

⌨️ 快捷键说明

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