private static void attachListeners(final JTextField text,
			final JList resultList) {
		text.addKeyListener(new KeyListener() {

			@Override
			public void keyTyped(KeyEvent e) {
			}

			@Override
			public void keyReleased(KeyEvent e) {
				if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
					searchFormFrame.setVisible(false);
				} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
					resultList.requestFocusInWindow();
				} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
					launch(resultList.getSelectedIndex(), e.isShiftDown());
				} else {
					searchAgain(text.getText());
				}
			}

			@Override
			public void keyPressed(KeyEvent e) {
			}
		});
		resultList.addKeyListener(new KeyListener() {

			@Override
			public void keyTyped(KeyEvent e) {
			}

			@Override
			public void keyReleased(KeyEvent e) {
			}

			@Override
			public void keyPressed(KeyEvent e) {
				if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
					searchFormFrame.setVisible(false);
				} else if (e.getKeyCode() == KeyEvent.VK_UP
						&& resultList.getSelectedIndex() == 0) {
					text.requestFocusInWindow();
				} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
					launch(resultList.getSelectedIndex(), e.isShiftDown());
				}
			}
		});
		resultList.addMouseListener(new MouseListener() {
			@Override
			public void mouseReleased(MouseEvent e) {
			}

			@Override
			public void mousePressed(MouseEvent e) {
			}

			@Override
			public void mouseExited(MouseEvent e) {
			}

			@Override
			public void mouseEntered(MouseEvent e) {
			}

			@Override
			public void mouseClicked(MouseEvent e) {
				if (e.getClickCount() == 2) {
					launch(resultList.getSelectedIndex(), e.isShiftDown());
				}
			}
		});
		resultList.addListSelectionListener(new ListSelectionListener() {

			@Override
			public void valueChanged(ListSelectionEvent e) {
				File f = model.getFile(resultList.getSelectedIndex());
				detailsLabel.setText(f.getAbsolutePath() + "\n"
						+ textBundle.getString("PM_SIZE") + ": "
						+ formatFileSize(f.length()));
			}
		});
	}