movebutton.java
来自「源码为科学出版社出版的英文<java设计模式>(影印版)所用的所有例」· Java 代码 · 共 29 行
JAVA
29 行
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.border.*;
import javax.accessibility.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class MoveButton extends JButton implements Command
{
Mediator med; //copy of the Mediator
public MoveButton(ActionListener fr, Mediator md)
{
super("Copy"); //create the button
addActionListener(fr); //add its listener
med = md; //copy in the Mediator instance
// med.registerMove(this); //register with the Mediator
}
public void Execute()
{ //execute the copy
med.action(this);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?