一份小小的练习

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);
}


}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值