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

📄 multievent1.java

📁 该原代码为<Java编程基础、应用与实例>的附盘代码
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
public class MultiEvent1 extends Frame implements ActionListener, TextListener{
  Label action=new Label();
  Label text=new Label();
  TextField tf=new TextField(20);
  public MultiEvent1(String title){
  	super(title);
  	action.setBackground(Color.GREEN);
  	text.setBackground(Color.PINK);
  	add(action,"North");
  	add(text,"Center");
  	add(tf,"South");
  	tf.addActionListener(this);
  	tf.addTextListener(this);
  }
  public void actionPerformed(ActionEvent e){
  	action.setText(tf.getText());
  }
  public void textValueChanged(TextEvent e){
  	text.setText(tf.getText());
  } 
  public static void main(String[] args){
    Frame f=new MultiEvent1("促吝 捞亥飘 贸府");
    f.pack();
    f.setVisible(true);    
  }
}

⌨️ 快捷键说明

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