/** * Hook method just before the dialog is made visible. */ @Override protected void beforeShow() { super.beforeShow(); m_Option = CANCEL_OPTION; }
/** * Initializes the members. */ @Override protected void initialize() { super.initialize(); m_Option = CANCEL_OPTION; }
/** * 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); } }); }
/** * Initializes the widgets. */ @Override protected void initGUI() { super.initGUI(); getContentPane().setLayout(new BorderLayout()); // buttons m_PanelButtons = new JPanel(new BorderLayout()); getContentPane().add(m_PanelButtons, BorderLayout.SOUTH); m_PanelButtonsLeft = new JPanel(new FlowLayout(FlowLayout.LEFT)); m_PanelButtons.add(m_PanelButtonsLeft, BorderLayout.WEST); m_PanelButtonsRight = new JPanel(new FlowLayout(FlowLayout.RIGHT)); m_PanelButtons.add(m_PanelButtonsRight, BorderLayout.EAST); }
/** * finishes the initialization, by setting size/location. */ @Override protected void finishInit() { super.finishInit(); pack(); setLocationRelativeTo(null); }