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

📄 e10_2.java

📁 几个不错的程序 是本人好多天的结果 真的和不错呀 适合java的学习
💻 JAVA
字号:
/**
 * @(#)E10_2.java
 *
 * Sample Applet application
 *
 * @author 
 * @version 1.00 06/10/26
 */
 
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class E10_2 extends Applet implements ActionListener
{
	Button button;
	TextField text1,text2;
	public void init() 
	{
		button=new Button("确定");
		text1=new TextField(10);
		text2=new TextField(10);
		text1.addActionListener(this);
		text2.addActionListener(this);
		button.addActionListener(this);
		button.setBackground(Color.pink);
		add(text1);
		add(text2);
		add(button);
	}

	public void actionPerformed(ActionEvent e)
	{
		if(e.getSource()==text1||e.getSource()==button)
		{
			String word=text1.getText();
			if(word.equals("girl"))
			   text2.setText("女孩");
		}
	}
}

⌨️ 快捷键说明

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