📄 scrollpane1.java
字号:
import java.awt.*;
public class ScrollPane1{
public static void main(String[] args){
Frame f=new Frame("ScrollPane");
ScrollPane sp=new ScrollPane(1);
Panel p=new Panel();
p.setLayout(new GridLayout(10,2));
p.setBackground(Color.BLUE);
p.setForeground(Color.WHITE);
sp.setBounds(10,30,180,160);
f.setLayout(null);
f.setSize(200,200);
for(int i=1;i<=10;i++){
p.add(new Label(i+"锅掳 饭捞喉"));
p.add(new Button(i+"锅掳 滚瓢"));
}
sp.add(p);
f.add(sp);
f.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -