?? block.java
字號(hào):
import javax.swing.*;
import java.awt.event.*;
public class Block extends JButton implements ActionListener
{
ImageIcon 翻開時(shí)的圖標(biāo)=null,關(guān)閉時(shí)的圖標(biāo)=null;
public Block()
{
addActionListener(this);
}
public ImageIcon 獲取翻開時(shí)的圖標(biāo)()
{
return 翻開時(shí)的圖標(biāo);
}
public ImageIcon 獲取關(guān)閉時(shí)的圖標(biāo)()
{
return 關(guān)閉時(shí)的圖標(biāo);
}
public void 設(shè)置翻開時(shí)的圖標(biāo)(ImageIcon icon)
{
翻開時(shí)的圖標(biāo)=icon;
}
public void 設(shè)置關(guān)閉時(shí)的圖標(biāo)(ImageIcon icon)
{
關(guān)閉時(shí)的圖標(biāo)=icon;
}
public void 設(shè)置圖標(biāo)(ImageIcon icon)
{
setIcon(icon);
}
public void actionPerformed(ActionEvent e)
{
this.setIcon(翻開時(shí)的圖標(biāo));
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -