private void initLayout() {
		self = this;
		window = JSObject.getWindow(self);
		// fileLocation.setEditable(false);
		fileNameField = new JTextField(25);
		fileNameField.setEditable(false);
		fileNameField.setBackground(Color.WHITE);
		
		chooseBtn = new JButton();
		chooseBtn.setText(getMessage(MessageCode.FTP_FILE_CHOOSE));
		
		uploadBtn = new JButton();
		uploadBtn.setText(getMessage(MessageCode.FTP_FILE_UPLOAD));
		uploadBtn.setEnabled(false);
		
		fileChooser = new JFileChooser();
		fileChooser.setDialogTitle(getMessage(MessageCode.FTP_FILECHOOSER_TITLE));
		fileChooser.setAcceptAllFileFilterUsed(false);
		
		final boolean filterTypes = StringUtils.isNotBlank(allowTypes);
		final boolean filterMaxSize = maxSize>0;
		
		if(filterTypes||filterMaxSize) {
			fileChooser.setFileFilter(new FileFilter() {
				@Override
				public String getDescription() {
					return filterTypes? getMessage(MessageCode.ALLOW_ALL_FILE) : getMessage(MessageCode.ALLOW_SOME_FILE) + allowTypes;
				}
				
				@Override
				public boolean accept(File f) {
					
					if (f.isDirectory()) {
						return true;
					}
					
					boolean flag = true;
					if(filterTypes) {
						flag = false;
						String ext = FilenameUtils.getExtension(f.getName());
						String[] types = StringUtils.split(allowTypes,",");
						for (String t : types) {
							if(StringUtils.equalsIgnoreCase(t, ext)) {
								flag = true;
								break;
							}
						}
					}
					
					if(flag && filterMaxSize) {
						flag = FileUtils.sizeOf(f) <= maxSize;
					}
					
					return flag;
				}
			});
		}
		
		progressInfo = new JLabel(getMessage(MessageCode.FTP_UPLOAD_PROGRESS));
		
		progressBar = new JProgressBar(0, 100);
		progressBar.setPreferredSize(new Dimension(380,20));
		// progressBar.setString("请选择文件");
		progressBar.setStringPainted(true);
		progressBar.setBorderPainted(true);
		// progressBar.setBackground(Color.gray);
		// progressBar.setForeground(Color.blue);
		
		progressPanel = new JPanel();
		progressPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
		progressPanel.add(progressInfo);
		progressPanel.add(progressBar);
		progressPanel.setBackground(Color.WHITE);
		progressPanel.setVisible(false);

		// main.add(fileLocation);
		selectPanel = new JPanel();
		selectPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
		selectPanel.add(fileNameField);
		selectPanel.add(chooseBtn);
		selectPanel.add(uploadBtn);
		selectPanel.setBackground(Color.WHITE);
		
		GridLayout layout = new GridLayout(2, 1);
		Container container = self.getContentPane();
		container.setLayout(layout);
		container.add(selectPanel);
		container.add(progressPanel);
		container.setBackground(Color.WHITE);
	}