setDefaultCloseOperation(DISPOSE_ON_CLOSE);  KeyHandler keyListener = new KeyHandler(); addKeyListener(keyListener);  find.addKeyListener(keyListener); replace.addKeyListener(keyListener);
	public SearchDialog(View view, String defaultFind)	{		super(view,jEdit.getProperty("search.title"),false);		this.view = view;		fileset = SearchAndReplace.getSearchFileSet();		find = new HistoryTextField("find");		find.setText(defaultFind);		replace = new HistoryTextField("replace");		keepDialog = new JCheckBox(jEdit.getProperty(			"search.keepDialog"),"on".equals(jEdit.getProperty(			"search.keepDialog.toggle")));		ignoreCase = new JCheckBox(jEdit.getProperty(			"search.ignoreCase"),SearchAndReplace.getIgnoreCase());		regexp = new JCheckBox(jEdit.getProperty(			"search.regexp"),SearchAndReplace.getRegexp());		multifile = new JCheckBox();		multifile.getModel().setSelected(!(fileset			instanceof CurrentBufferSet));		multifileBtn = new JButton(jEdit.getProperty(			"search.multifile"));		findBtn = new JButton(jEdit.getProperty("search.findBtn"));		replaceSelection = new JButton(jEdit.getProperty("search"			+ ".replaceSelection"));		replaceSelection.setMnemonic(jEdit.getProperty("search"			+ ".replaceSelection.mnemonic").charAt(0));		replaceAll = new JButton(jEdit.getProperty("search.replaceAll"));		replaceAll.setMnemonic(jEdit.getProperty("search.replaceAll"			+ ".mnemonic").charAt(0));		cancel = new JButton(jEdit.getProperty("common.cancel"));		getContentPane().setLayout(new BorderLayout());		JPanel panel = new JPanel();		GridBagLayout layout = new GridBagLayout();		panel.setLayout(layout);		GridBagConstraints constraints = new GridBagConstraints();		constraints.gridwidth = constraints.gridheight = 1;		constraints.fill = constraints.BOTH;		JLabel label = new JLabel(jEdit.getProperty("search.find"),			SwingConstants.RIGHT);		layout.setConstraints(label,constraints);		panel.add(label);		constraints.gridx = 1;		constraints.gridwidth = constraints.REMAINDER;		constraints.weightx = 1.0f;		layout.setConstraints(find,constraints);		panel.add(find);		constraints.gridx = 0;		constraints.gridwidth = 1;		constraints.gridy = 1;		constraints.weightx = 0.0f;		label = new JLabel(jEdit.getProperty("search.replace"),			SwingConstants.RIGHT);		layout.setConstraints(label,constraints);		panel.add(label);		constraints.gridx = 1;		constraints.gridwidth = constraints.REMAINDER;		constraints.weightx = 1.0f;		layout.setConstraints(replace,constraints);		panel.add(replace);		getContentPane().add(BorderLayout.NORTH,panel);		panel = new JPanel();		panel.add(keepDialog);		panel.add(ignoreCase);		panel.add(regexp);		panel.add(multifile);		panel.add(multifileBtn);		getContentPane().add(BorderLayout.CENTER,panel);		panel = new JPanel();		panel.add(findBtn);		panel.add(replaceSelection);		panel.add(replaceAll);		panel.add(cancel);		getRootPane().setDefaultButton(findBtn);		getContentPane().add(BorderLayout.SOUTH,panel);		setDefaultCloseOperation(DISPOSE_ON_CLOSE);		KeyHandler keyListener = new KeyHandler();		addKeyListener(keyListener);		find.addKeyListener(keyListener);		replace.addKeyListener(keyListener);		ActionHandler actionListener = new ActionHandler();		multifile.addActionListener(actionListener);		multifileBtn.addActionListener(actionListener);		findBtn.addActionListener(actionListener);		replaceSelection.addActionListener(actionListener);		replaceAll.addActionListener(actionListener);		cancel.addActionListener(actionListener);				pack();		GUIUtilities.loadGeometry(this,"search");		show();		find.requestFocus();	}