JPanel pathPanel = new JPanel(new BorderLayout()); pathPanel.add(BorderLayout.WEST,new JLabel(jEdit.getProperty( "vfs.ftp.browser.path"),SwingConstants.RIGHT)); pathPanel.add(BorderLayout.CENTER,pathField = new JTextField(path)); pathPanel.setBorder(new EmptyBorder(5,0,0,0)); centerPanel.add(BorderLayout.SOUTH,pathPanel);
cons.gridy++; cons.gridwidth = 1; cons.weightx = cons.weighty = 0.0f; label = new JLabel(jEdit.getProperty("vfs.ftp.browser.path"), SwingConstants.RIGHT); layout.setConstraints(label,cons); centerPanel.add(label);
	public FtpBrowser(View view, Buffer buffer, int type)	{		super(view,jEdit.getProperty("vfs.ftp.browser."			+ (type == OPEN ? "open" : "save") + "-title"),true);		this.view = view;		this.type = type;		// Get default values for fields from buffer's current		// settings		String host, user, password, path = null;		if(buffer.getVFS() instanceof FtpVFS)		{			FtpAddress address = new FtpAddress(buffer.getPath());			host = address.host + ":" + address.port;			user = address.user;			if(user == null)				user = (String)buffer.getProperty(FtpVFS.USERNAME_PROPERTY);			password = address.password;			if(password == null)				password = (String)buffer.getProperty(FtpVFS.PASSWORD_PROPERTY);			path = address.path;			if(type == OPEN)				path = MiscUtilities.getFileParent(path);		}		else		{			host = jEdit.getProperty("vfs.ftp.browser.host.value");			user = jEdit.getProperty("vfs.ftp.browser.user.value");			password = null;			path = null;		}		JPanel topPanel = new JPanel(new BorderLayout());		JPanel topLabels = new JPanel(new GridLayout(3,1));		topLabels.add(new JLabel(jEdit.getProperty("vfs.ftp.browser.host"),			SwingConstants.RIGHT));		topLabels.add(new JLabel(jEdit.getProperty("vfs.ftp.browser.username"),			SwingConstants.RIGHT));		topLabels.add(new JLabel(jEdit.getProperty("vfs.ftp.browser.password"),			SwingConstants.RIGHT));		topPanel.add(BorderLayout.WEST,topLabels);		JPanel topFields = new JPanel(new GridLayout(3,1));		topFields.add(hostField = new JTextField(host));		topFields.add(userField = new JTextField(user));		topFields.add(passwordField = new JPasswordField(password));		topFields.setBorder(new EmptyBorder(0,0,5,0));		topPanel.add(BorderLayout.CENTER,topFields);		getContentPane().add(BorderLayout.NORTH,topPanel);		JPanel centerPanel = new JPanel(new BorderLayout());		list = new JList();		list.setVisibleRowCount(10);		list.addListSelectionListener(new ListHandler());		list.addMouseListener(new MouseHandler());		list.setCellRenderer(new FileCellRenderer());		centerPanel.add(BorderLayout.CENTER,new JScrollPane(list));		JPanel pathPanel = new JPanel(new BorderLayout());		pathPanel.add(BorderLayout.WEST,new JLabel(jEdit.getProperty(			"vfs.ftp.browser.path"),SwingConstants.RIGHT));		pathPanel.add(BorderLayout.CENTER,pathField = new JTextField(path));		pathPanel.setBorder(new EmptyBorder(5,0,0,0));		centerPanel.add(BorderLayout.SOUTH,pathPanel);		getContentPane().add(BorderLayout.CENTER,centerPanel);		JPanel buttons = new JPanel();		ActionHandler actionHandler = new ActionHandler();		// the below locks the preferred size so that the buttons		// don't jump around		select = new JButton(jEdit.getProperty("vfs.ftp.browser.connect"));		select.setPreferredSize(select.getPreferredSize());		select.addActionListener(actionHandler);		buttons.add(select);		up = new JButton(jEdit.getProperty("vfs.ftp.browser.up"));		up.addActionListener(actionHandler);		buttons.add(up);		refresh = new JButton(jEdit.getProperty("vfs.ftp.browser.refresh"));		refresh.addActionListener(actionHandler);		buttons.add(refresh);		cancel = new JButton(jEdit.getProperty("common.cancel"));		cancel.addActionListener(actionHandler);		buttons.add(cancel);		getContentPane().add(BorderLayout.SOUTH,buttons);		addWindowListener(new WindowHandler());		setDefaultCloseOperation(DISPOSE_ON_CLOSE);		update();		pack();		setLocationRelativeTo(view);		show();	}