?? lessonviewe.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 + -