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

📄 lessonviewe.java

📁 看课程说明的小程序
💻 JAVA
字号:
//<applet code = "lessonviewe.class" height = 100 width = 300></applet>
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class lessonviewe extends Applet implements ItemListener
{
	Choice choice;
	Label label;
	TextArea text;
	public void init()
	{
		setLayout(new BorderLayout());
		text = new TextArea(" ",10,10);
		choice = new Choice();
		choice.add("语文");
		choice.add("数学");
		choice.add("物理");
		choice.add("化学");
		add(choice);
		add("North",choice);
		add("Center",text);
		choice.addItemListener(this);
	}
	public void itemStateChanged(ItemEvent e)
	{
		if(e.getItemSelectable()==choice)
		{
			if(choice.getSelectedIndex()==0)
			{
				text.setText("chinese");
			}
			else if(choice.getSelectedIndex()==1)
			{
				text.setText("math");
			}
			else if(choice.getSelectedIndex()==2)
			{
				text.setText("physics");
			}
			else if(choice.getSelectedIndex()==3)
			{
				text.setText("chemistry");
			}
		}
	}
}
		

⌨️ 快捷键说明

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