22import java.awt.BorderLayout;
23import java.awt.Component;
25import java.awt.event.ActionEvent;
26import java.awt.event.ActionListener;
27import java.awt.event.WindowEvent;
29import javax.swing.JButton;
30import javax.swing.JComponent;
31import javax.swing.JDialog;
32import javax.swing.JPanel;
76 this(refForPlacement,
false);
92 setLocationRelativeTo(refForPlacement);
101 this.setLayout(
new BorderLayout());
102 setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
105 btnDone.setToolTipText(
"Processes data and closes dialog");
106 btnDone.addActionListener(
new ActionListener() {
109 public void actionPerformed(ActionEvent e) {
114 btnCanc =
new JButton(
"Cancel");
115 btnCanc.setToolTipText(
"Exit dialog.");
116 btnCanc.addActionListener(
new ActionListener() {
119 public void actionPerformed(ActionEvent e) {
157 this.add(comp, BorderLayout.NORTH);
168 this.add(comp, BorderLayout.CENTER);
GUIModalDialog(Component refForPlacement, boolean useExtraButton)
Constructor.
JButton btnCanc
The button that is used to close the dialog without processing any input.
static final long serialVersionUID
Version UID.
void addToCentralPane(JComponent comp)
Adds a component to the central part of this dialog frame.
JButton btnExtra
The button that can be used for any action that does not close the dialog.
JButton btnDone
The button that is used to launch the processing of the data given to the open dialog,...
Object result
The result to be returned once the dialog is closed.
void initialize(boolean useExtraButton)
Object showDialog()
Shows the dialog and restrains the modality to it, until the dialog gets closed.
GUIModalDialog(Component refForPlacement)
Constructor.
void addToNorthPane(JComponent comp)
Adds a component to the topmost part of this dialog frame.
void close()
Closes the dialog window.