📄 allcomponent.java
字号:
import java.awt.*;
import java.applet.*;
public class allComponent extends Applet{
List list;
Label testLabel;
Button testButton;
Checkbox testCheckbox;
Choice testChoice;
Scrollbar test_h_Scrollbar;
TextArea testTextArea;
TextField testTextField;
public void init(){
setLayout(new FlowLayout());
//left align
list=new List(4,true);
list.add("one");
list.add("two");
list.add("three");
list.add("four");
list.add("five");
list.add("six");
list.add("seven");
list.add("eight");
list.add("nine");
add(list);
testLabel=new Label("Label");
add(testLabel);
testButton=new Button("Button");
add(testButton);
testCheckbox=new Checkbox("Checkbox");
add(testCheckbox);
testChoice=new Choice();
testChoice.addItem("Choice1");
testChoice.addItem("Choice2");
testChoice.addItem("Choice3");
testChoice.addItem("Choice4");
add(testChoice);
test_h_Scrollbar=new Scrollbar(Scrollbar.HORIZONTAL,50,10,0,1000);
add(test_h_Scrollbar);
testTextArea=new TextArea("TextArea",3,30);
add(testTextArea);
testTextField=new TextField("TextField",30);
add(testTextField);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -