listModel = new DefaultListModel(); list = new JList(listModel);
list = new JList(); list.setVisibleRowCount(16);
	public FtpBrowser(View view, Buffer buffer, int type)	{		super(view,jEdit.getProperty("vfs.ftp.browser."			+ (type == OPEN ? "open" : "save") + "-title"),true);		this.type = type;		// Get default values for fields from buffer's current		// settings		String _host, _username, _password, _path = null;		if(buffer.getVFS() instanceof FtpVFS)		{			FtpAddress address = new FtpAddress(buffer.getPath());			_host = address.host + ":" + address.port;			_username = address.user;			if(_username == null)				_username = (String)buffer.getProperty(FtpVFS.USERNAME_PROPERTY);			_password = address.password;			if(_password == null)				_password = (String)buffer.getProperty(FtpVFS.PASSWORD_PROPERTY);			_path = MiscUtilities.getFileParent(address.path);		}		else		{			_host = null;			_username = null;			_password = null;			_path = null;		}		JPanel topPanel = new JPanel(new BorderLayout());		JPanel topLabels = new JPanel(new GridLayout(4,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));		topLabels.add(new JLabel(jEdit.getProperty("vfs.ftp.browser.path"),			SwingConstants.RIGHT));		topPanel.add(BorderLayout.WEST,topLabels);		JPanel topFields = new JPanel(new GridLayout(4,1));		topFields.add(host = new JTextField(_host));		topFields.add(username = new JTextField(_username));		topFields.add(password = new JPasswordField(_password));		topFields.add(path = new JTextField(_path));		topPanel.add(BorderLayout.CENTER,topFields);		getContentPane().add(BorderLayout.NORTH,topPanel);		JPanel buttons = new JPanel();		select = new JButton(jEdit.getProperty("vfs.ftp.browser."			+ (type == OPEN ? "open" : "save")));		buttons.add(select);		// the below locks the preferred size so that the buttons		// don't jump around when toggling between connected and		// disconnected		connect = new JButton(jEdit.getProperty("vfs.ftp.browser.disconnect"));		connect.setPreferredSize(connect.getPreferredSize());		buttons.add(connect);		home = new JButton(jEdit.getProperty("vfs.ftp.browser.home"));		buttons.add(home);		refresh = new JButton(jEdit.getProperty("vfs.ftp.browser.refresh"));		buttons.add(refresh);		cancel = new JButton(jEdit.getProperty("common.cancel"));		buttons.add(cancel);		listModel = new DefaultListModel();		list = new JList(listModel);		list.addListSelectionListener(new ListHandler());		getContentPane().add(BorderLayout.CENTER,new JScrollPane(list));		getContentPane().add(BorderLayout.SOUTH,buttons);		updateButtons();		pack();		setLocationRelativeTo(view);		show();	}