01: package net.matuschek.jobo;
02:
03: import javax.swing.BoxLayout;
04: import javax.swing.JButton;
05: import javax.swing.JPanel;
06:
07: import net.matuschek.swing.JHideFrame;
08: import net.matuschek.swing.OptionPanel;
09:
10: /*********************************************
11: Copyright (c) 2001 by Daniel Matuschek
12: *********************************************/
13:
14: /**
15: * Configuration dialog for filters
16: *
17: * @author Daniel Matuschek
18: * @version $Revision: 1.3 $
19: */
20: public class FilterConfigFrame extends JHideFrame {
21:
22: private static final long serialVersionUID = -115214206470304510L;
23:
24: public FilterConfigFrame() {
25: super ("Filter configuration");
26: initComponents();
27: }
28:
29: protected void initComponents() {
30: JPanel mainPanel = new JPanel();
31: mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
32: setContentPane(mainPanel);
33:
34: OptionPanel dialogPanel = new OptionPanel(2);
35:
36: JPanel buttonPanel = new JPanel();
37: buttonPanel.setLayout(new BoxLayout(buttonPanel,
38: BoxLayout.X_AXIS));
39:
40: mainPanel.add(dialogPanel);
41: mainPanel.add(buttonPanel);
42:
43: /** Dialog panel **/
44: /** End of Dialog panel */
45:
46: /** Button panel */
47: JButton okButton = new JButton();
48: okButton.setText("OK");
49: okButton.addActionListener(new java.awt.event.ActionListener() {
50: public void actionPerformed(java.awt.event.ActionEvent evt) {
51: updateAndHide();
52: }
53: });
54: buttonPanel.add(okButton);
55:
56: JButton closeButton = new JButton();
57: closeButton.setText("Cancel");
58: closeButton
59: .addActionListener(new java.awt.event.ActionListener() {
60: public void actionPerformed(
61: java.awt.event.ActionEvent evt) {
62: exitForm();
63: }
64: });
65: buttonPanel.add(closeButton);
66: /** End of button panel */
67:
68: pack();
69: }
70:
71: /**
72: * update the settings from the form contents and hide window
73: */
74: protected void updateAndHide() {
75: this .setVisible(false);
76: }
77:
78: /**********************************************************************/
79: /**********************************************************************/
80: /**********************************************************************/
81:
82: }
|