?? first.java~42~
字號:
package testsystem;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class first
{
public static void main(String[] args) {
Frame demoFrame=new Frame();
Label lab=new Label("0.",Label.RIGHT);
Panel pn=new Panel();
demoFrame.setSize(400,300);
demoFrame.setLocation(300,300);
demoFrame.setLayout(null);
pn.setLayout(new GridLayout(4,4));
String s[]={"7","8","9","/","4","5","6","*","1","2","3","-","0",".","=","+"};
for(int i=0;i<16;i++)
{
pn.add(new Button(s[i]));
}
lab.setBackground(Color.orange);
lab.setBounds(20,30,160,20);
pn.setBounds(20,60,160,80);
demoFrame.add(lab);
demoFrame.add(pn);
demoFrame.setVisible(true);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -