package comgui;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Work extends JFrame{
MyButton m = new MyButton("刪除", 100, 300, this);
MyButton m1= new MyButton("修改", 200, 300, this);
MyButton m2= new MyButton("添加", 300, 300, this);
MyButton m3= new MyButton("查找", 400, 300, this);
MyTest t= new MyTest("姓名",50,50,this);
MyTest t1= new MyTest("民族",50,100,this);
MyTest t2= new MyTest("職務",50,150,this);
MyTest t3= new MyTest("工資",50,200,this);
public Work(){
this.setLayout(null);
// Jlb("姓名", 50);
// Jlb("民族", 100);
// Jlb("職務", 150);
// Jlb("工資", 200);
//
// Tx(50);
// Tx(100);
// Tx(150);
// Tx(200);
// JT("刪除", 100, 300);
// JT("修改", 200, 300);
// JT("添加", 300, 300);
// JT("查找", 400, 300);
this.setSize(600,600);
this.setDefaultCloseOperation(3);
this.setTitle("練習框");
this.setLocationRelativeTo(null);
this.setVisible(true);
}
public static void main(String[] args) {
Work f= new Work();
}
public void Jlb(String name,int Ju){
JLabel jl1=new JLabel(name);
jl1.setBounds(50,Ju,50,50);
jl1.setFont(new Font("宋體",Font.BOLD,20));
this.add(jl1);
}
public void Tx(int JT1){
JTextField jte= new JTextField();
jte.setBounds(130, JT1, 150, 40);
jte.setBackground(Color.yellow);
this.add(jte);
}
public void JT(String t,int x,int y){
JButton j= new JButton(t);
j.setBounds(x,y,80,20);
this.add(j);
}
}
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Work extends JFrame{
MyButton m = new MyButton("刪除", 100, 300, this);
MyButton m1= new MyButton("修改", 200, 300, this);
MyButton m2= new MyButton("添加", 300, 300, this);
MyButton m3= new MyButton("查找", 400, 300, this);
MyTest t= new MyTest("姓名",50,50,this);
MyTest t1= new MyTest("民族",50,100,this);
MyTest t2= new MyTest("職務",50,150,this);
MyTest t3= new MyTest("工資",50,200,this);
public Work(){
this.setLayout(null);
// Jlb("姓名", 50);
// Jlb("民族", 100);
// Jlb("職務", 150);
// Jlb("工資", 200);
//
// Tx(50);
// Tx(100);
// Tx(150);
// Tx(200);
// JT("刪除", 100, 300);
// JT("修改", 200, 300);
// JT("添加", 300, 300);
// JT("查找", 400, 300);
this.setSize(600,600);
this.setDefaultCloseOperation(3);
this.setTitle("練習框");
this.setLocationRelativeTo(null);
this.setVisible(true);
}
public static void main(String[] args) {
Work f= new Work();
}
public void Jlb(String name,int Ju){
JLabel jl1=new JLabel(name);
jl1.setBounds(50,Ju,50,50);
jl1.setFont(new Font("宋體",Font.BOLD,20));
this.add(jl1);
}
public void Tx(int JT1){
JTextField jte= new JTextField();
jte.setBounds(130, JT1, 150, 40);
jte.setBackground(Color.yellow);
this.add(jte);
}
public void JT(String t,int x,int y){
JButton j= new JButton(t);
j.setBounds(x,y,80,20);
this.add(j);
}
}