自定义简单面板

package nc.ui.ldzl.dlg;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import nc.ui.ldzl.ref.PactRefModel;
import nc.ui.pub.beans.UIButton;
import nc.ui.pub.beans.UIDialog;
import nc.ui.pub.beans.UILabel;
import nc.ui.pub.beans.UIRefPane;

public class PactDialog extends UIDialog implements ActionListener{

	private static final long serialVersionUID = 1L;
	//主面板
	private javax.swing.JPanel ivjUIDialogContentPane = null;
	//标签 
	private UILabel labPactNo;
	//参照
	private UIRefPane refPact;
	//确定按钮
	private UIButton btnOK;
	//取消按钮
	private UIButton btnCancel;
	
	public PactDialog(){
		super();
		init();
	}
	
	private void init() {
		this.setName("QueryDialog");
		this.setTitle("合同号录入界面");
		this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);//关闭就退出
		this.setSize(300, 170);
		this.setContentPane(this.getUIDialogContentPane());
		this.getBtnOK().addActionListener(this);
		this.getbtnCancel().addActionListener(this);
	}
	//主面板的初始化
	public javax.swing.JPanel getUIDialogContentPane(){
		if(ivjUIDialogContentPane == null){
			ivjUIDialogContentPane = new javax.swing.JPanel();
			ivjUIDialogContentPane.setName("UIDialogContentPane");//名称
			ivjUIDialogContentPane.setLayout(null);
			ivjUIDialogContentPane.add(this.getLabPactNo(), this.getLabPactNo().getName());
			ivjUIDialogContentPane.add(this.getRefPact(), this.getRefPact().getName());
			ivjUIDialogContentPane.add(this.getBtnOK(), this.getBtnOK().getName());
			ivjUIDialogContentPane.add(this.getbtnCancel(), this.getbtnCancel().getName());
		}
		return ivjUIDialogContentPane;
	}
	
	/**
	 * 取得合同号标签
	 * @return
	 */
	public UILabel getLabPactNo(){
		if(labPactNo == null){
			labPactNo = new UILabel();
			labPactNo.setText("合同号:");
			labPactNo.setName("UILabel");
			labPactNo.setBounds(30, 30, 100, 30);
		}
		return labPactNo;
	}
	/**
	 * 取得合同号参照
	 * @return
	 */
	public UIRefPane getRefPact(){
		if(refPact == null){
			refPact = new UIRefPane();
			refPact.setRefModel(new PactRefModel());
			refPact.setName("UIRefPane");
			refPact.setBounds(90, 35, 170, 30);
		}
		return refPact;
	}
	
	/**
	 * 取得确定按钮
	 * @return
	 */
	public UIButton getBtnOK(){
		if(btnOK == null){
			btnOK = new UIButton();
			btnOK.setText("确定");
			btnOK.setName("UIButton1");
			btnOK.setBounds(65, 80, 80, 20);
		}
		return btnOK;
	}
	/**
	 * 取得取消按钮
	 * @return
	 */
	public UIButton getbtnCancel(){
		if(btnCancel == null){
			btnCancel = new UIButton();
			btnCancel.setText("取消");
			btnCancel.setName("UIButton2");
			btnCancel.setBounds(165, 80, 80, 20);
		}
		return btnCancel;
	}
	
	public void actionPerformed(ActionEvent event) {
		if(event.getSource().equals(this.getBtnOK())){
			
		}
		else if(event.getSource().equals(this.getbtnCancel())){
			this.closeCancel();
		}
	}

}


 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值