/** * Creates a dialog with the specified owner Frame, modality and title. * * @param owner the owning frame * @param title the title of the dialog * @param modal whether the dialog is modal or not */ public BaseDialog(Frame owner, String title, boolean modal) { super(owner, title, modal); initialize(); initGUI(); finishInit(); }
/** * For initializing the GUI. */ protected void initGUI() { setDefaultCloseOperation(BaseDialog.HIDE_ON_CLOSE); }
/** * closes/shows the dialog. * * @param value if true then display the dialog, otherwise close it */ public void setVisible(boolean value) { if (value) beforeShow(); else beforeHide(); super.setVisible(value); if (value) afterShow(); else afterHide(); } }
/** * 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); }
/** * Creates a dialog with the specified title, modality and the specified * owner Dialog. * * @param owner the owning dialog * @param title the title of the dialog * @param modality the type of modality */ public BaseDialog(Dialog owner, String title, ModalityType modality) { super(owner, title, modality); initialize(); initGUI(); finishInit(); }