// Create a path field with auto-completion capabilities
this.locationField = new FilePathField();
locationField.getDocument().addDocumentListener(this);
compPanel.addRow(Translator.get("location")+":", locationField, 10);
YBoxPanel yPanel = new YBoxPanel(10);
yPanel.add(compPanel);
// Add buttons: 'remove', 'move up' and 'move down' buttons are enabled
// only if there is at least one bookmark in the table
XBoxPanel buttonsPanel = new XBoxPanel();
JPanel buttonGroupPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
MnemonicHelper mnemonicHelper = new MnemonicHelper();
// New bookmark button
newButton = new JButton(Translator.get("edit_bookmarks_dialog.new"));
newButton.setMnemonic(mnemonicHelper.getMnemonic(newButton));
newButton.addActionListener(this);
buttonGroupPanel.add(newButton);
// Duplicate bookmark button
duplicateButton = new JButton(Translator.get("duplicate"));
duplicateButton.setMnemonic(mnemonicHelper.getMnemonic(duplicateButton));
duplicateButton.addActionListener(this);
buttonGroupPanel.add(duplicateButton);
// Remove bookmark button
removeButton = new JButton(bookmarkList.getRemoveAction());
removeButton.setMnemonic(mnemonicHelper.getMnemonic(removeButton));
buttonGroupPanel.add(removeButton);
// Go to bookmark button
goToButton = new JButton(Translator.get("go_to"));
goToButton.setMnemonic(mnemonicHelper.getMnemonic(goToButton));
goToButton.addActionListener(this);
buttonGroupPanel.add(goToButton);
buttonsPanel.add(buttonGroupPanel);
// Button that closes the window
closeButton = new JButton(Translator.get("close"));
closeButton.setMnemonic(mnemonicHelper.getMnemonic(closeButton));
closeButton.addActionListener(this);
buttonsPanel.add(Box.createHorizontalGlue());
buttonsPanel.add(closeButton);
yPanel.add(buttonsPanel);
contentPane.add(yPanel, BorderLayout.SOUTH);
// Set initial text components and buttons' enabled state
updateComponents();