private void initialize() {

		// window
		frame = new JFrame();
		frame.setResizable(false);
		frame.setBounds(100, 100, 800, 600);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		JMenuBar menuBar = new JMenuBar();
		frame.setJMenuBar(menuBar);

		JMenu mnAbout = new JMenu("About...");
		menuBar.add(mnAbout);

		JMenuItem mntmAbout = new JMenuItem("About...");
		mntmAbout.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				JOptionPane.showMessageDialog(frame, "Vincent");
			}
		});
		mnAbout.add(mntmAbout);
		frame.getContentPane().setLayout(new GridLayout(0, 1, 0, 0));

		JPanel panel = new JPanel();
		frame.getContentPane().add(panel);
		panel.setLayout(null);

		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setAutoscrolls(true);
		scrollPane.setBounds(0, 0, 794, 178);
		panel.add(scrollPane);

		textArea = new JTextArea();
		scrollPane.setViewportView(textArea);
		textArea.setMargin(new Insets(0, 5, 0, 0));
		textArea.setWrapStyleWord(true);
		textArea.setLineWrap(true);
		textArea.setEditable(false);
		DefaultCaret caret = (DefaultCaret) textArea.getCaret();
		caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);

		final JButton btnNewButton = new JButton("Share Files");
		btnNewButton.setEnabled(false);
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				fileChooser.setMultiSelectionEnabled(true);
				fileChooser.showOpenDialog(frame);
				File[] files = fileChooser.getSelectedFiles();
				for (File file : files) {
//					if (peer.shareFile(file)) {
//						textArea.append(SystemUtil.getSimpleTime() + "share file [" + file.getName() + "]\n");
//					} else {
//						textArea.append(SystemUtil.getSimpleTime() + "Unable to register file [" + file.getName() + "]\n");
//					}
				}

			}
		});
		btnNewButton.setBounds(19, 266, 122, 26);
		panel.add(btnNewButton);

		final JButton btnDownloadFiles = new JButton("Download Files");
		btnDownloadFiles.setEnabled(false);
		btnDownloadFiles.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				final String fileName = textField_downloadFileName.getText();
				if ("".equals(fileName)) {
					JOptionPane.showMessageDialog(frame, "The file name is not valid!", "ERROR", JOptionPane.ERROR_MESSAGE);
					return;
				}
				JOptionPane.showMessageDialog(frame, "Please select a directory to save the file", "INFO", JOptionPane.INFORMATION_MESSAGE);
				fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
				if (fileChooser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {
					final String path = fileChooser.getSelectedFile().getAbsolutePath();
					LOGGER.info("received user saved file path:" + path);
					File file = new File(path + File.separator + fileName);
					if (file.exists()) {
						JOptionPane.showMessageDialog(frame, "The file already exits", "ERROR", JOptionPane.ERROR_MESSAGE);
						return;
					}
					label.setText("Saved Path: " + path);
					Thread t = new Thread(new Runnable() {
						public void run() {
							peer.downloadFile(fileName, path + File.separator + fileName);
						}
					});
					LOGGER.info("start a new thread for downloading file.");
					t.start();
					
					
					
				}

			}
		});
		btnDownloadFiles.setBounds(19, 303, 122, 26);
		panel.add(btnDownloadFiles);

		textField_downloadFileName = new JTextField();
		textField_downloadFileName.setEnabled(false);
		textField_downloadFileName.setColumns(10);
		textField_downloadFileName.setBounds(151, 302, 122, 28);
		panel.add(textField_downloadFileName);

		progressBar = new JProgressBar();
		progressBar.setStringPainted(true);
		progressBar.setDoubleBuffered(true);
		progressBar.setBounds(19, 340, 254, 20);
		panel.add(progressBar);
		progressBar.setVisible(false);

		textField_downloadLimit = new JTextField();
		textField_downloadLimit.setEnabled(false);
		textField_downloadLimit.setText("1");
		textField_downloadLimit.setColumns(10);
		textField_downloadLimit.setBounds(465, 301, 45, 28);
		panel.add(textField_downloadLimit);

		label = new JLabel("");
		label.setBounds(25, 383, 458, 46);
		panel.add(label);

		JLabel lblBandwidth = new JLabel("Bandwidth");
		lblBandwidth.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblBandwidth.setBounds(405, 301, 66, 28);
		panel.add(lblBandwidth);

		JLabel lblKbs = new JLabel("KB/S");
		lblKbs.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblKbs.setBounds(522, 301, 66, 28);
		panel.add(lblKbs);

		final JButton btnClearScreen = new JButton("Clear Screen");
		btnClearScreen.setEnabled(false);
		btnClearScreen.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				textArea.setText("");
			}
		});
		btnClearScreen.setBounds(662, 189, 122, 28);
		panel.add(btnClearScreen);

		final JButton btnConnect = new JButton("connect");
		btnConnect.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {

					try {
						LOGGER.info("Loading network configuration file...");
						new PropertyUtil("network.properties");
					} catch (FileNotFoundException e1) {
						textArea.append(SystemUtil.getSimpleTime() + "Network configuration file not found.\n");
						LOGGER.debug("Network configuration file not found", e1);
						return;
					} catch (IOException e1) {
						textArea.append(SystemUtil.getSimpleTime() + "Unknown I/O error.\n");
						LOGGER.debug("Unknown I/O error.", e1);
						return;
					}

					// register service port
					peerRegistry = LocateRegistry.createRegistry(Integer.valueOf(textField_servicePort.getText()));
					peerRegistry.rebind("peerTransfer", peerTransfer);
					LOGGER.info("open service port " + Integer.valueOf(textField_servicePort.getText()) + ", bind object peerTransfer");

					if (peerRegistry != null) {
						LOGGER.info("Register service port [" + Integer.valueOf(textField_servicePort.getText()) + "] successfully!");
					} else {
						textArea.append(SystemUtil.getSimpleTime() + "Unable to register service port [2055]!\n");
						LOGGER.error("Unable to register service port [" + Integer.valueOf(textField_servicePort.getText()) + "]!");
						return;
					}

					btnConnect.setEnabled(false);
					textField_servicePort.setEnabled(false);
					
					// peer
					peer.setPeer_service_port(textField_servicePort.getText());

					// button enable
					btnNewButton.setEnabled(true);
					btnDownloadFiles.setEnabled(true);
					btnClearScreen.setEnabled(true);
					textField_downloadFileName.setEnabled(true);
					textField_downloadLimit.setEnabled(true);
					

					TimerTask task = new TimerTask() {

						@Override
						public void run() {
							LOGGER.debug("Cleanup message table.");
							peer.cleanupMessageTable();

						}
					};

					Timer timer = new Timer();
					timer.schedule(task, 0, 1000);

				} catch (ConnectException e1) {
					JOptionPane.showMessageDialog(frame, "unable to connect to server!\nplease make sure the address is correct", "ERROR",
							JOptionPane.ERROR_MESSAGE);
					return;
				} catch (RemoteException e1) {
					JOptionPane.showMessageDialog(frame, "unknown server error! \nplease try again later", "ERROR", JOptionPane.ERROR_MESSAGE);
					return;
				}
			}
		});
		btnConnect.setBounds(283, 190, 117, 29);
		panel.add(btnConnect);

		textField_servicePort = new JTextField();
		textField_servicePort.setText("1099");
		textField_servicePort.setColumns(10);
		textField_servicePort.setBounds(151, 190, 122, 28);
		panel.add(textField_servicePort);

		JLabel lblServicePort = new JLabel("Service Port");
		lblServicePort.setBounds(67, 194, 86, 16);
		panel.add(lblServicePort);
		
		

	}