`
wuhaidong
  • 浏览: 365100 次
  • 性别: Icon_minigender_1
  • 来自: 青岛
社区版块
存档分类
最新评论

自定义简单面板

    博客分类:
  • NC
阅读更多

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

}


 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics