10 |
|
|
11 |
import net.miginfocom.swing.MigLayout; |
import net.miginfocom.swing.MigLayout; |
12 |
import schmitzm.swing.JPanel; |
import schmitzm.swing.JPanel; |
|
import schmitzm.swing.SwingUtil; |
|
13 |
|
|
14 |
public abstract class CancellableTabbedDialogAdapter extends |
public abstract class CancellableTabbedDialogAdapter extends |
15 |
CancellableDialogAdapter { |
CancellableDialogAdapter { |
42 |
contentPane.add(buttons); |
contentPane.add(buttons); |
43 |
|
|
44 |
setContentPane(contentPane); |
setContentPane(contentPane); |
|
SwingUtil.centerFrameOnScreen(this); |
|
45 |
|
|
46 |
} |
} |
47 |
|
|
48 |
/** |
/** |
49 |
* Is only called once! Doesn't use lazy initialization. Use |
* Is only called once! Doesn't use lazy initialization. Use |
50 |
* <code>super.createButtons.add( newButton )</code> to add buttons. |
* <code>super.createButtons.add( newButton )</code> to add buttons. |
|
* |
|
|
* @return |
|
51 |
*/ |
*/ |
52 |
protected JPanel createButtons() { |
protected JPanel createButtons() { |
53 |
final JPanel buttonsJPanel = new JPanel(new MigLayout("width 100%")); |
final JPanel buttonsJPanel = new JPanel(new MigLayout()); |
54 |
|
|
55 |
final OkButton okButton = new OkButton(new AbstractAction() { |
final OkButton okButton = new OkButton(new AbstractAction() { |
56 |
{ |
{ |
77 |
|
|
78 |
}); |
}); |
79 |
|
|
80 |
buttonsJPanel.add(okButton); |
buttonsJPanel.add(okButton, "tag ok"); |
81 |
|
|
82 |
final CancelButton cancelButton = new CancelButton(new AbstractAction( |
final CancelButton cancelButton = new CancelButton(new AbstractAction( |
83 |
"") { |
"") { |
85 |
cancelClose(); |
cancelClose(); |
86 |
} |
} |
87 |
}); |
}); |
88 |
buttonsJPanel.add(cancelButton); |
buttonsJPanel.add(cancelButton, "tag cancel"); |
89 |
|
|
90 |
return buttonsJPanel; |
return buttonsJPanel; |
91 |
} |
} |