/** * Initializes the widgets. */ @Override protected void initGUI() { super.initGUI(); m_FontPanel = new FontChooserPanelWithPreview(); getContentPane().add(m_FontPanel, BorderLayout.CENTER); m_ButtonOK = new JButton("OK"); m_ButtonOK.setMnemonic('O'); m_PanelButtonsRight.add(m_ButtonOK); m_ButtonOK.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { m_Current = m_FontPanel.getCurrent(); dispose(); setVisible(false); } }); m_ButtonCancel = new JButton("Cancel"); m_ButtonCancel.setMnemonic('C'); m_PanelButtonsRight.add(m_ButtonCancel); m_ButtonCancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { m_FontPanel.setCurrent(m_Current); dispose(); setVisible(false); } }); }