⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addclientdialog.java

📁 本文首先介绍了这些考试系统的形成和发展过程
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package net.robin.crm.ui;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.HeadlessException;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JDialog;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import java.awt.CardLayout;
import java.awt.GridLayout;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import javax.swing.JComboBox;
import javax.swing.JTextField;

import net.robin.crm.service.CRMService;
import net.robin.crm.service.Category;
import net.robin.crm.service.Client;
import net.robin.crm.service.Company;
import net.robin.crm.service.ConfigException;
import net.robin.crm.service.InstanceExeption;
import net.robin.crm.service.ServiceException;
import net.robin.crm.util.Util;

import com.michaelbaranov.microba.calendar.DatePicker;
import javax.swing.JFileChooser;

public class AddClientDialog extends JDialog {

	private JPanel jContentPane = null;
	private JPanel centerPanel = null;
	private JPanel buttonPanel = null;
	private JPanel rightPanel = null;
	private JButton okButton = null;
	private JButton cancelButton = null;
	private JPanel dataPanel = null;
	private JPanel clientPanel = null;
	private JPanel photoPanel = null;
	private JPanel photoLablePanel = null;
	private JLabel photoLabel = null;
	private JPanel photoButtonPanel = null;
	private JButton photoButton = null;
	private JPanel photoInputPanel = null;
	private JPanel clientDatePanel = null;
	private JPanel categoryPanel = null;
	private JLabel categoryLabel = null;
	private JComboBox categoryComboBox = null;
	private JPanel namePanel = null;
	private JPanel phonePanel = null;
	private JPanel emailPanel = null;
	private JPanel mobilePanel = null;
	private JPanel qqPanel = null;
	private JPanel sexPanel = null;
	private JPanel companyPanel = null;
	private JPanel birthdayPanel = null;
	private JLabel nameLabel = null;
	private JTextField nameTextField = null;
	private JLabel phoneLabel = null;
	private JTextField phoneTextField = null;
	private JLabel emailLabel = null;
	private JTextField emailTextField = null;
	private JLabel mobileLabel = null;
	private JTextField mobileTextField = null;
	private JLabel qqLabel = null;
	private JTextField qqTextField = null;
	private JLabel sexLabel = null;
	private JComboBox sexComboBox = null;
	private JLabel companyLabel = null;
	private JComboBox companyComboBox = null;
	private JLabel birthdayLabel = null;
	private DatePicker birthdayDatePicker = null;
	
	private Action action = new Action();
	private JFileChooser photoFileChooser = null;  //  @jve:decl-index=0:visual-constraint="590,37"
	private PhotoFileFilter photoFileFilter = null;  //  @jve:decl-index=0:visual-constraint=""
	private JFileChooser jFileChooserfff = null;  //  @jve:decl-index=0:visual-constraint="591,214"
	
	public AddClientDialog() throws HeadlessException {
		super();
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Dialog owner) throws HeadlessException {
		super(owner);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Dialog owner, boolean modal)
			throws HeadlessException {
		super(owner, modal);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Frame owner) throws HeadlessException {
		super(owner);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Frame owner, boolean modal) throws HeadlessException {
		super(owner, modal);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Dialog owner, String title) throws HeadlessException {
		super(owner, title);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Dialog owner, String title, boolean modal)
			throws HeadlessException {
		super(owner, title, modal);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Frame owner, String title) throws HeadlessException {
		super(owner, title);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Frame owner, String title, boolean modal)
			throws HeadlessException {
		super(owner, title, modal);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Dialog owner, String title, boolean modal,
			GraphicsConfiguration gc) throws HeadlessException {
		super(owner, title, modal, gc);
		// TODO 自动生成构造函数存根
		initialize();
	}

	public AddClientDialog(Frame owner, String title, boolean modal,
			GraphicsConfiguration gc) {
		super(owner, title, modal, gc);
		// TODO 自动生成构造函数存根
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(542, 445);
		this.setTitle("添加客户");
		this.setContentPane(getJContentPane());
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getCenterPanel(), java.awt.BorderLayout.CENTER);
		}
		return jContentPane;
	}

	/**
	 * This method initializes centerPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getCenterPanel() {
		if (centerPanel == null) {
			centerPanel = new JPanel();
			centerPanel.setLayout(new BorderLayout());
			centerPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(6,6,6,6));
			centerPanel.add(getButtonPanel(), java.awt.BorderLayout.SOUTH);
			centerPanel.add(getDataPanel(), java.awt.BorderLayout.CENTER);
		}
		return centerPanel;
	}

	/**
	 * This method initializes buttonPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getButtonPanel() {
		if (buttonPanel == null) {
			buttonPanel = new JPanel();
			buttonPanel.setLayout(new BorderLayout());
			buttonPanel.add(getRightPanel(), java.awt.BorderLayout.EAST);
		}
		return buttonPanel;
	}

	/**
	 * This method initializes rightPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getRightPanel() {
		if (rightPanel == null) {
			rightPanel = new JPanel();
			rightPanel.add(getOkButton(), null);
			rightPanel.add(getCancelButton(), null);
		}
		return rightPanel;
	}

	/**
	 * This method initializes okButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getOkButton() {
		if (okButton == null) {
			okButton = new JButton();
			okButton.setText("添加");
			okButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					//System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
					action.ok();
				}
			});
		}
		return okButton;
	}

	/**
	 * This method initializes cancelButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getCancelButton() {
		if (cancelButton == null) {
			cancelButton = new JButton();
			cancelButton.setText("取消");
			cancelButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					//System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
					action.cancel();
				}
			});
		}
		return cancelButton;
	}

	/**
	 * This method initializes dataPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getDataPanel() {
		if (dataPanel == null) {
			dataPanel = new JPanel();
			dataPanel.setLayout(new BorderLayout());
			dataPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "客户信息", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
			dataPanel.add(getClientPanel(), java.awt.BorderLayout.CENTER);
			dataPanel.add(getPhotoPanel(), java.awt.BorderLayout.EAST);
		}
		return dataPanel;
	}

	/**
	 * This method initializes clientPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getClientPanel() {
		if (clientPanel == null) {
			clientPanel = new JPanel();
			clientPanel.setLayout(new BorderLayout());
			//clientPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "客户信息", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
			clientPanel.add(getClientDatePanel(), java.awt.BorderLayout.NORTH);
		}
		return clientPanel;
	}

	/**
	 * This method initializes photoPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getPhotoPanel() {
		if (photoPanel == null) {
			photoPanel = new JPanel();
			photoPanel.setLayout(new BorderLayout());
			photoPanel.add(getPhotoInputPanel(), java.awt.BorderLayout.NORTH);
		}
		return photoPanel;
	}

	/**
	 * This method initializes photoLablePanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getPhotoLablePanel() {
		if (photoLablePanel == null) {
			photoLabel = new JLabel();
			photoLabel.setText("");
			photoLabel.setIcon(new ImageIcon(getClass().getResource("/net/robin/crm/ui/mk.jpg")));
			photoLablePanel = new JPanel();
			photoLablePanel.add(photoLabel, null);
		}
		return photoLablePanel;
	}

	/**
	 * This method initializes photoButtonPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getPhotoButtonPanel() {
		if (photoButtonPanel == null) {
			photoButtonPanel = new JPanel();
			photoButtonPanel.add(getPhotoButton(), null);
		}
		return photoButtonPanel;
	}

	/**
	 * This method initializes photoButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getPhotoButton() {
		if (photoButton == null) {
			photoButton = new JButton();
			photoButton.setIcon(new ImageIcon(getClass().getResource("/net/robin/crm/image/man24.png")));
			photoButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					//System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
					action.loadPhoto();
				}
			});
		}
		return photoButton;
	}

	/**
	 * This method initializes photoInputPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getPhotoInputPanel() {
		if (photoInputPanel == null) {
			photoInputPanel = new JPanel();
			photoInputPanel.setLayout(new BorderLayout());
			photoInputPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "照片", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
			photoInputPanel.add(getPhotoLablePanel(), java.awt.BorderLayout.CENTER);
			photoInputPanel.add(getPhotoButtonPanel(), java.awt.BorderLayout.SOUTH);
		}
		return photoInputPanel;
	}

	/**
	 * This method initializes clientDatePanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getClientDatePanel() {
		if (clientDatePanel == null) {
			GridLayout gridLayout = new GridLayout();
			gridLayout.setRows(9);
			gridLayout.setVgap(6);
			gridLayout.setColumns(1);
			clientDatePanel = new JPanel();
			clientDatePanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(8,8,8,8));
			clientDatePanel.setLayout(gridLayout);
			clientDatePanel.add(getNamePanel(), null);
			clientDatePanel.add(getPhonePanel(), null);
			clientDatePanel.add(getEmailPanel(), null);
			clientDatePanel.add(getMobilePanel(), null);
			clientDatePanel.add(getQqPanel(), null);
			clientDatePanel.add(getSexPanel(), null);
			clientDatePanel.add(getCompanyPanel(), null);
			clientDatePanel.add(getCategoryPanel(), null);
			clientDatePanel.add(getBirthdayPanel(), null);
		}
		return clientDatePanel;
	}

	/**
	 * This method initializes categoryPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getCategoryPanel() {
		if (categoryPanel == null) {
			categoryLabel = new JLabel();
			categoryLabel.setText("分类");
			BorderLayout borderLayout = new BorderLayout();
			borderLayout.setHgap(5);
			categoryPanel = new JPanel();
			categoryPanel.setLayout(borderLayout);
			categoryPanel.add(categoryLabel, java.awt.BorderLayout.WEST);
			categoryPanel.add(getCategoryComboBox(), java.awt.BorderLayout.CENTER);
		}
		return categoryPanel;
	}

	/**
	 * This method initializes categoryComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getCategoryComboBox() {
		if (categoryComboBox == null) {
			categoryComboBox = new JComboBox();
		}
		return categoryComboBox;
	}

	/**
	 * This method initializes namePanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getNamePanel() {
		if (namePanel == null) {
			BorderLayout borderLayout1 = new BorderLayout();
			borderLayout1.setHgap(6);
			borderLayout1.setVgap(6);
			nameLabel = new JLabel();
			nameLabel.setText("姓名");
			namePanel = new JPanel();
			namePanel.setLayout(borderLayout1);
			namePanel.add(nameLabel, java.awt.BorderLayout.WEST);
			namePanel.add(getNameTextField(), java.awt.BorderLayout.CENTER);
		}
		return namePanel;
	}

	/**
	 * This method initializes phonePanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getPhonePanel() {
		if (phonePanel == null) {
			phoneLabel = new JLabel();
			phoneLabel.setText("电话");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -