/**
* Creates a font chooser that will keep the specified font up-to-date in the current theme data.
* @param fontId identifier of the font this chooser will be editing.
*/
protected FontChooser createFontChooser(int fontId) {
FontChooser fontChooser; // Font chooser that will be returned.
ChangeListener listener; // Internal listener.
// Initialises the font chooser.
fontChooser = new FontChooser(themeData.getFont(fontId));
fontChooser.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.font")));
fontChooser.addChangeListener(listener = new ThemeFontChooserListener(themeData, fontId, parent));
// Hold a reference to this listener to prevent garbage collection
listenerReferences.add(listener);
return fontChooser;