[Java]_ch15.1_視窗元件原理介紹
package YPU;
import java.awt.Button;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Label;
public class A15 {
public static void main(String args[])
{
Frame frm=new Frame();
frm.setLayout(null);
frm.setVisible(true);
frm.setSize(300, 300);
frm.setLocation(800, 300);
frm.setTitle("巨匠電腦新竹認證");
frm.setBackground(Color.PINK);
Label lb=new Label();
lb.setText("視窗元件設計");
lb.setBackground(Color.YELLOW);
lb.setSize(200, 50);
lb.setLocation(50, 50);
Button btn1=new Button("送出");
btn1.setSize(100, 50);
btn1.setLocation(50, 110);
Button btn2=new Button("清除");
btn2.setSize(100, 50);
btn2.setLocation(150, 110);
frm.add(btn1);
frm.add(btn2);
frm.add(lb);
}
}
沒有留言:
張貼留言